Copy link to clipboard
Copied
Hello Acrobat community!
I hope everything is good with you..
I have a document which inittialy have 4 pages (already numberes using footer).
1. info
2. table
3. desc
4. signature
I have a button on page 3 (desc) that adds a template to the document, so my document becomes:
1. info
2. table
3. desc
4. addi
5. signature
The issue happens on page 4 which have no number on it and page 5 still displaying in the footer page 4.
Is there any way to fix this issue?
Thank you very much!
Copy link to clipboard
Copied
You could use text fields instead, that updates with page number when you spawn template (script would need to run in same place where you spawn template after you spawn template)
Copy link to clipboard
Copied
Is there anyway to add a footer page numbers using javascript?
I will only add the page numbers when the user click a button to validate the form and print it.
Thank you for your reply, if there is no way of adding page number afterwords, then I will use the suggested method using text fields.
Copy link to clipboard
Copied
You can try using this, modify it to your needs if needed, it can be used in a button (like when you submit):
for (var i = 0; i < this.numPages; i++) {
var pageNumber = "Page " + (i + 1) + " of " + this.numPages;//here edit the look of the number (e.g., 'Page 1 of 3', or 1/3...etc
var textProperties = {
cFont: "Helvetica",
nFontSize: 10,
nStart: 10,
cColor: color.black};
var position = {
nHorizAlign: app.constants.align.right,
nVertAlign: app.constants.align.bottom,
nHorizOffset: -40,
nVertOffset: 20};
this.addWatermarkFromText({
cText: pageNumber,
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.bottom,
nHorizOffset: 0,
nVertOffset: 20,
nFontSize: 10,
nRotation: 0,
bOnTop: true,
nStart: i,
nEnd: i});}
Copy link to clipboard
Copied
Use read only text fields and scripts if you want dynamic updating:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now