Highlighted

Importing JavaScript variable data

New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

Currently I have quite a bit of data in my JavaScript and would like to tidy this up a bit and maintain it through maybe a spreadsheet. If there anyway to import this data into my PDF's without keeping it in the JavaScript? The data does change depending on variables within the PDF so I'm not sure how that would work with this. For example if x is written in this box, the value in another box would be Blue, if y is written the value should be Red.

 

Any suggestions?

TOPICS
PDF forms

Views

10

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

Importing JavaScript variable data

New Here ,
Jul 31, 2020

Copy link to clipboard

Copied

Currently I have quite a bit of data in my JavaScript and would like to tidy this up a bit and maintain it through maybe a spreadsheet. If there anyway to import this data into my PDF's without keeping it in the JavaScript? The data does change depending on variables within the PDF so I'm not sure how that would work with this. For example if x is written in this box, the value in another box would be Blue, if y is written the value should be Red.

 

Any suggestions?

TOPICS
PDF forms

Views

11

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
Jul 31, 2020 0
try67 LATEST
Most Valuable Participant ,
Jul 31, 2020

Copy link to clipboard

Copied

It's possible to use an external data source and then read it using a script, parse it and use the values from it later on.

The file has to be in a known location and must be a plain-text file, though, for the script to be able to read it.

You can use the util.readFileIntoStream method for reading the file, for example.

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...
Jul 31, 2020 0