Highlighted

Replacing placeholder text in PDF headers with Filename

New Here ,
Nov 04, 2020

Copy link to clipboard

Copied

I have 1000's of PDF that all need to have their headers added and modified to show the following:

 

"Filename" / "Page Number" 

 

Thus far I have managed to use the Action Wizard in Acrobat DC to get all the headers in the PDF's to show:

 

xx (Placeholder text) / 1 (using the page number function in headers & footers)

 

Is there a way to replace the "xx" (placeholder text) with the PDF filename (excl. the ".pdf") in the header using JavaScript? And can this be done in a way to automate it for all the PDF's selected?

TOPICS
Acrobat SDK and JavaScript, Edit and convert PDFs

Views

53

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

Replacing placeholder text in PDF headers with Filename

New Here ,
Nov 04, 2020

Copy link to clipboard

Copied

I have 1000's of PDF that all need to have their headers added and modified to show the following:

 

"Filename" / "Page Number" 

 

Thus far I have managed to use the Action Wizard in Acrobat DC to get all the headers in the PDF's to show:

 

xx (Placeholder text) / 1 (using the page number function in headers & footers)

 

Is there a way to replace the "xx" (placeholder text) with the PDF filename (excl. the ".pdf") in the header using JavaScript? And can this be done in a way to automate it for all the PDF's selected?

TOPICS
Acrobat SDK and JavaScript, Edit and convert PDFs

Views

54

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
Nov 04, 2020 0
Adobe Community Professional ,
Nov 04, 2020

Copy link to clipboard

Copied

How does you add the headers?

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...
Nov 04, 2020 0
New Here ,
Nov 04, 2020

Copy link to clipboard

Copied

Hi Bernd,

 

I used the Action Wizard and the Add Header & Footer tool. 

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...
Nov 04, 2020 0
Most Valuable Participant ,
Nov 04, 2020

Copy link to clipboard

Copied

You need to use a script. For example, you can add a unique (read-only) text field to each page and then apply that text as its value. There's no built-in option of doing that with the Add Header & Footer tool.

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...
Nov 04, 2020 0
Adobe Community Professional ,
Nov 04, 2020

Copy link to clipboard

Copied

For the filename use form text fields or watermarks.

Javascript can't replace the XX.

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...
Nov 04, 2020 0