• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic stamp using the values in excel file

New Here ,
Jun 14, 2020 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

694

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
community guidelines
Community Expert ,
Jun 15, 2020 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.

Votes

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
community guidelines
New Here ,
Jun 15, 2020 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

Votes

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
community guidelines
New Here ,
Jun 16, 2020 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

 

Votes

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
community guidelines
Community Expert ,
Jun 16, 2020 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.

Votes

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
community guidelines
New Here ,
Jun 16, 2020 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

Votes

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
community guidelines
Community Expert ,
Jun 16, 2020 Jun 16, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines