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

Page number with 2 digits

Community Beginner ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Hello,

I have this code and my goal is get file name with pagenumber, but with two digits ike pdfname 01 pdfname 02... pdfname 09 pdfname 10

Thanks for your help

var nazev = this.documentFileName.replace(/.pdf/,"")

for (var p = 0; p < this.numPages; p++) { this.addWatermarkFromText({ cText: (nazev)+(p + 1 ), nHorizAlign: app.constants.align.center, nVertAlign: app.constants.align.bottom, nHorizValue: 10, nVertValue: 2, nFontSize: 10, nStart: p});

}

TOPICS
Acrobat SDK and JavaScript , Windows

Views

443

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
community guidelines

correct answers 1 Correct answer

Community Expert , May 14, 2019 May 14, 2019

Use this:

cText: (nazev)+util.printf("%02d", (p + 1))

Votes

Translate

Translate
Community Expert ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Use this:

cText: (nazev)+util.printf("%02d", (p + 1))

Votes

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
community guidelines
Community Beginner ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

LATEST

thanks

Votes

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
community guidelines