Skip to main content
Known Participant
March 3, 2021
Question

QR Codes

  • March 3, 2021
  • 1 reply
  • 1047 views

I would ask about pdf file !

I have a pdf file and I would to generate QR code when rename file. ex: file name is 12345678 the QR code must represent this value .
note : programing language that used in adobe acrobat pro dc is JavaScript

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 3, 2021

Try this:

 

event.value = this.documentFileName.replace(/\.pdf$i/, "");

 

However, this will not execute when the file is opened. To do that you would need to add the following code under Tools - JavaScript - Document JavaScripts (NOT inside of a function):

 

this.calculateNow();

 

Also note that this won't work in Reader, only in Acrobat.

NPH CoAuthor
Known Participant
March 4, 2021

Almost done thank you for help

 

Finally I would like to ask about file extension, if we can to remove from QR code when read it

 

(for example: the file name is 12345, QR reader gives me 12345.pdf

try67
Community Expert
Community Expert
March 4, 2021

The code I provided above does it already.