Dynamic stamp using the values in excel file

New Here ,
Jun 14, 2020

Copy link to clipboard

Copied

Hello

i want to stamp dynamically on the pdf documnets which were received by an outlook email as attachments.

i created a dynamic stamp using two text fields (Received Date and Time) with user manually input the data and it is working fine.

but, i would like to know is there any way, so that dynamic stamp would take the two values ((Received Date and Time) dynamically from the outlook email.

For the time being , I tried creating a macro in outlook to update an excel file with these two fields.

but i stuck in updating javascript to take that values from excel file for the text fields in the pdf dynamic stamp.

i am new the javascript. could anyone help me with this please.

i hope i described my problems well and thanks for your support

regards
Shas

TOPICS
Acrobat SDK and JavaScript

Views

119

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

Dynamic stamp using the values in excel file

New Here ,
Jun 14, 2020

Copy link to clipboard

Copied

Hello

i want to stamp dynamically on the pdf documnets which were received by an outlook email as attachments.

i created a dynamic stamp using two text fields (Received Date and Time) with user manually input the data and it is working fine.

but, i would like to know is there any way, so that dynamic stamp would take the two values ((Received Date and Time) dynamically from the outlook email.

For the time being , I tried creating a macro in outlook to update an excel file with these two fields.

but i stuck in updating javascript to take that values from excel file for the text fields in the pdf dynamic stamp.

i am new the javascript. could anyone help me with this please.

i hope i described my problems well and thanks for your support

regards
Shas

TOPICS
Acrobat SDK and JavaScript

Views

120

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
Jun 14, 2020 0
Most Valuable Participant ,
Jun 15, 2020

Copy link to clipboard

Copied

No, you can't read values from an Excel file. You can read them from a plain-text file, though.

To do that you would need to use the util.readFileFromStream method.

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...
Jun 15, 2020 0
New Here ,
Jun 15, 2020

Copy link to clipboard

Copied

Thnak you so much for the reply.

since i am very new to this area, could you please explain little more or guide me where i can find a start.

regards

shas

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...
Jun 15, 2020 0
New Here ,
Jun 16, 2020

Copy link to clipboard

Copied

try67, I have been searching for the method you mentioned, "util.readFileFromStream". so far no luck. I modified my outlook macro to create a text file with a single line text (Received Date). so far my code for dynamic stamp look like below:

 

var fileName = "C:\\recDate.txt";

var cDate = util.readFileFromStream(filename)  * Here is i stuck now

event.value = cDate

 

regards

Shas

 

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...
Jun 16, 2020 0
Most Valuable Participant ,
Jun 16, 2020

Copy link to clipboard

Copied

Your file-path is incorrect. It needs to be:

var fileName = "/C/recDate.txt";

However, there are other issues.

One, the file has to be in a "Safe path", ie on in a sensitive folder like the root folder of a drive.

Also, if you want to specify the file-path when calling this function then you have to run it from a trusted context, eg. a folder-level script.

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...
Jun 16, 2020 0
New Here ,
Jun 16, 2020

Copy link to clipboard

Copied

thnks try67.

the file is alright in my desktop. "C:\Users\shas\Desktop\recDate.txt)

but still I don't know how to get the single line text in the text file and assign that string to dynamci stamp's text filed using above mentioned method.

regards

Shas

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...
Jun 16, 2020 0
try67 LATEST
Most Valuable Participant ,
Jun 16, 2020

Copy link to clipboard

Copied

The first step should be reading the documentation of this method. Using it is not trivial and requires understanding of the input parameter, the context in which it needs to run and the type of output it returns.

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...
Jun 16, 2020 0