Numbering every page in document with odd numbers.  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Aceus0904
User
Posts: 2
Joined: Wed Apr 30, 2025 12:50 pm

Numbering every page in document with odd numbers.

Post by Aceus0904 »

Hello, i need some help. :?

For work related reasons i need to number around 6000 pdf pages with odd numbers.

For example: Page 1 / Number 1, Page 2 / Number 3, Page 3 / Number 5, Page 4 / Number 7 and so on.

Is there a Macro or an Option to do this automatically?

Thanks for helping me! :D
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11021
Joined: Wed Jan 03, 2018 6:52 pm

Re: Numbering every page in document with odd numbers.

Post by Daniel - PDF-XChange »

Hello, Aceus0904

I am sorry to say that there is no function I can think of to accomplish this using the default tools.
It may be possible as a JavaScript action... Something along the lines of adding a blank page after every page that is present, then number the document normally, and then delete the blank pages that were added, but that is not something I can offer help creating.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
rakunavi
User
Posts: 1672
Joined: Sat Sep 11, 2021 5:04 am

Re: Numbering every page in document with odd numbers.  SOLVED

Post by rakunavi »

Hello Aceus0904,

The following script might align with your wish.

Code: Select all

for (var k = 0; k < this.numPages; k++) {
    this.setPageLabels(k, ["D", "", (k * 2) + 1]);
}
  • Animation.gif
Best regards,
rakunavi
You do not have the required permissions to view the files attached to this post.
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19856
Joined: Mon Jan 12, 2009 8:07 am

Re: Numbering every page in document with odd numbers.

Post by Stefan - PDF-XChange »

Hello rakunavi,

Many thanks for the suggested script and the video demonstrating that it works!
That is indeed a nice solution!

@Aceus0904 - you can also add such a script as a toolbar button as well:
How do I add a custom tool to the toolbar using JavaScript in the Editor

Kind regards,
Stefan
Aceus0904
User
Posts: 2
Joined: Wed Apr 30, 2025 12:50 pm

Re: Numbering every page in document with odd numbers.

Post by Aceus0904 »

Thank you so much rakunavi, this was exactly what i needed! :D

I guess i need to look into java script programming because it seems you can do quite a lot with these consoles!
User avatar
rakunavi
User
Posts: 1672
Joined: Sat Sep 11, 2021 5:04 am

Re: Numbering every page in document with odd numbers.

Post by rakunavi »

Hello Aceus0904, thank you for your feedback.
You're welcome, I'm glad I could help. :D

Best regards,
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11021
Joined: Wed Jan 03, 2018 6:52 pm

Re: Numbering every page in document with odd numbers.

Post by Daniel - PDF-XChange »

Hello, rakunavi

Thank you very much for jumping in to help here! It is very much appreciated!

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com