Copy link to clipboard
Copied
I have been tasked with creating a fillable PDF file for the company with a serial number that updates whenever said PDF is filled out, printed and filed. The initial description was to "create a form that has a different serial number each time it is printed". My solution is as below:
I created a variable text element that reads as year, month, day, minute and second. This way when we need to look the file up we can easily call up all form created in a certain year, or a certain month,and the minute/second at the end will theroetically mean that there are no duplicates.
Therein lies my problem.
When exported to a PDF (I have tried numerous settings for interative and otherwise), the "serial number" is static to when I exported the document to a PDF from inDesign and does not update when the PDF is opened.
Ex. I exported the file at 9:59.13am on March 17th, 2021, and so the variable data always reads as "213175913".
Is there a way to have the variable data update itself when the exported PDF is opened or resaved, or is this a lost cause?
Copy link to clipboard
Copied
You will need to use a JavaScript in the PDF to auto-update the serial number/date into a read-only field. This would be done in Acrobat, not InDesign. I would inlcude a 2- or 3-digit random number with the date to make it unlikely that the same number is ever used.
https://planetpdf.com/example-acrobat-javascripts/
Scroll down to: