Need your support on auto filling form from custom properties

New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Hi All,

I am new to the environment, My requirement We created some custom fields for pdf document and we created a pdf form as well. Now our requirement is what data is available in Custom Properties it has to auto fill in the pdf form. I heard we can achive using javascript. Could someone please help me on this.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

599

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Need your support on auto filling form from custom properties

New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Hi All,

I am new to the environment, My requirement We created some custom fields for pdf document and we created a pdf form as well. Now our requirement is what data is available in Custom Properties it has to auto fill in the pdf form. I heard we can achive using javascript. Could someone please help me on this.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

600

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

HI,

 

Are you wanting to copy some of the data from the document information to some fields on the document?

 

Regards

Malcolm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Thank you So much for your response. Yes you are I want to copy from custom Properties to the form fields inside the document. 

Kindly help me as it is urgent for my use case. let me know if you need any additional information.

 

Thanks,

Naveen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

The Acrobat JavaScript reference includes information about document info fields: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Hi johnson,

Thank you so much, is it same for Custom Properties as well or anything else we need to follow

regards

Naveen

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

It should work. Here's a code sample the gets the value from a custom info field and populates a text field:

 

getField("Text1").value = info["My Custom Info Field"];

 

where "My Custom Info Field" is the name of the info field you want to use.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Hi Johnson,

 

Thank you so much for the detailed information. I have tried the above code my not getting the results I have attached the screenshot of my Javascript code, form fields, and custom properties. Kindly let me know where my I am doing wrong.CustomFields.PNGpdf1.PNG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

It's not clear to me if the project number field name is what you used, or if you actually called the test function. Also, "Name" is not one of the custom fields that you've set up, so you should try "SourceModified", "Company", or "Comments" instead.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

Where does you call this function?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

Hi Johnson,

Yes I am using Project Number field. I tried changing to SourceModified. but still it is not coming.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

I am new to this, I am not calling could you please let me how call for the specific field in the template

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

It might be easiest if you could post a sample document.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

it is the sample code:

 

function test()
{

getField("Project No:").value = info["SourceModified"];

}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

This defines a function. Where does you run/execute the function?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 20, 2020

Copy link to clipboard

Copied

I am not sure where exactly I have to keep. Now I am calling like this.

pdf2.PNG

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
Adobe Community Professional ,
Mar 20, 2020

Copy link to clipboard

Copied

It might be best to review your requirements. I understand you want to fill a form field with the same information that's in a custom info field. What's not clear is when this needs to be done. How is the custom info added to the document in the first place? When are the form fields added, and is it an automated process of a manual one? It seems like you'd only need to run the script once, before the document is made available for others to use, is that right?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2020 0
New Here ,
Mar 23, 2020

Copy link to clipboard

Copied

Hi Johnson/Bernd,

 

Could you please help me on this.

 

Thanks,

Naveen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2020 0
Adobe Community Professional ,
Mar 23, 2020

Copy link to clipboard

Copied

Check the console for errors.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2020 0
Adobe Community Professional ,
Mar 23, 2020

Copy link to clipboard

Copied

Hi,

 

Are you able to share a sample document that we could use to show how to solve the problem?

 

Your are trying to get a field called "Project No:", that is the text that appears on the form, but is it actually the name of the field?

As you are running on the DocumentClose event, I am not sure if this would be saved, could you move it to a button or something on the form, for the sake of easier testing, and making sure the code is working as expected.

 

Regards

 

Malcolm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2020 0
New Here ,
Mar 24, 2020

Copy link to clipboard

Copied

Hi Johnson/Bernd,

 

Could you please help me on this. I have to complete this ASAP.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 24, 2020 0
New Here ,
Mar 24, 2020

Copy link to clipboard

Copied

Could you please help me on this?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 24, 2020 0
Adobe Community Professional ,
Mar 31, 2020

Copy link to clipboard

Copied

Hi,

 

I am not sure that any change made on the Will Close event would not be saved as the Save is probably already done.

 

Can you post a sample document that we can investigate?

 

Regards

 

Malcolm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 31, 2020 0
New Here ,
Apr 07, 2020

Copy link to clipboard

Copied

Hi Barlae/Johnson,

 

Kindly let me know your availability please let me I will connect with you for 5 mints.

 

Thanks,

Naveen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 07, 2020 0
Adobe Community Professional ,
Apr 07, 2020

Copy link to clipboard

Copied

HI,

 

I am around most days, feel free to email "info @ barlaedc .co .uk" (without spaces) if you want to take this conversation off the forums.

 

Regards

Malcolm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 07, 2020 0
New Here ,
Apr 07, 2020

Copy link to clipboard

Copied

Hi Barlae,

 

I send you an email could you please check once and let me know you inputs. 

Thanks,

Naveen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 07, 2020 0
New Here ,
Apr 08, 2020

Copy link to clipboard

Copied

Hi Barle,

 

Could you please check my mail and let me know. It is little urgent.

Thanks,

Naveen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 08, 2020 0
Adobe Community Professional ,
Apr 14, 2020

Copy link to clipboard

Copied

Hi Naveen,

 

I have uploaded a document to this folder - https://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fPhttps://adobe.ly/2Vaq4fP https://adobe.ly/2Vaq4fP in the folder called "InfoToField", this should how the field could be populated by the document information field called Keywords, on document open.

 

you can see the script by searching for the word "JavaScript" and open the document JavaScripts. this code also has console outputs so that you can see if it working by looking in the console.

 

Regards

Malcolm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2020 0
New Here ,
Apr 14, 2020

Copy link to clipboard

Copied

Hi Malcolm,

 

Thank you so much for your help. I am not able to open the above folder I am getting inder page.

 

Thanks,

Naveen

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2020 0
Adobe Community Professional ,
Apr 15, 2020

Copy link to clipboard

Copied

It is not a public link.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2020 0
New Here ,
Apr 15, 2020

Copy link to clipboard

Copied

then how to access that link.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2020 0