Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
12

Adding amount of pages into a dynamic stamp

Community Beginner ,
Feb 16, 2024 Feb 16, 2024

Hi guys,

 

complete newbie here, trying to create a dynamic stamp that will count and appropriately add the amount of pages within my PDF. 

I have created a dynamic stamp with a text box im just unsure what to do next, any help would be super appreciated 🙂

 

TIA

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2024 Feb 16, 2024

To get the total number of pages in a document, use the doc property numPages.

ABAMBO | Hard- and Software Engineer | Photographer
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 16, 2024 Feb 16, 2024

thats not what i'm looking to do. 

 

I need the java script to input within a text box on this dynamic stamp to auto-fill the number of pages on the open pdf.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2024 Feb 16, 2024

As the custom calculation script of that field enter:

if (event.source) event.value = event.source.source.numPages;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 16, 2024 Feb 16, 2024

 for some reason it wont let me paste anything?

 

as I said I am a complete novice at this I apoligise and thank you for the help in advance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2024 Feb 16, 2024

Click on the "Edit" button.

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 16, 2024 Feb 16, 2024

managed to paste it in but the text box just goes translecent and nothing happens, 

its fine im giving up. :@

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2024 Feb 16, 2024

When you apply the stamp it will be populated. If it doesn't, please share the stamp file here.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2024 Feb 16, 2024
LATEST

Here's a working example...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines