386 Feature Request: Apply Bookmark to Page Label
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
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Thanks for sorting this out, Mathew. I was quickly developing the impression the solution was above my pay grade.
Glad you got there in the end, ANR!
Glad you got there in the end, ANR!
All best,
FringePhil
FringePhil
-
ANR_Designs_NC
- User
- Posts: 10
- Joined: Wed Sep 24, 2025 6:41 pm
-
Dimitar - PDF-XChange
- Site Admin
- Posts: 2731
- Joined: Mon Jan 15, 2018 9:01 am
-
Mathew
- User
- Posts: 855
- Joined: Thu Jun 19, 2014 7:30 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
I've updated the tool to add optional regular expression to check against the bookmarks before assigning page labels, and option to add page numbering to the label. This change allows me to number pages based on just part of the bookmark.
If regex is left blank, and page numbering is <None> it works the same as before. If you’re updating in v11 or later, the location of the JavaScript folder has moved! viewtopic.php?t=49522
tl;dr
I frequently combine multiple individual pdf files to make one file, and use the New Document > Combine Files into a Single PDF command to do that (it adds root bookmarks for each, and includes their bookmarks, which is great). The problem I was having was that I also want to set page numbering, and that command (as of PXCE v.11.0.1) loses those page numbers. I'd not thought of using my tool until FringePhil explained how in this post: viewtopic.php?p=204264#p204264
Thus I can take bookmarks like this: and if I put a regular expression to just match the number at the beginning (ie with the settings shown on the image of the tool dialog above), it will number pages using just the matching part. ie, for 06.1 the pages would be numbered
06.1.1, 06.1.2, 06.1.3, ...
and the next section 07.0 would be
07.0.1, 07.0.2, ....
etc
Changes in v2.0
If regex is left blank, and page numbering is <None> it works the same as before. If you’re updating in v11 or later, the location of the JavaScript folder has moved! viewtopic.php?t=49522
tl;dr
I frequently combine multiple individual pdf files to make one file, and use the New Document > Combine Files into a Single PDF command to do that (it adds root bookmarks for each, and includes their bookmarks, which is great). The problem I was having was that I also want to set page numbering, and that command (as of PXCE v.11.0.1) loses those page numbers. I'd not thought of using my tool until FringePhil explained how in this post: viewtopic.php?p=204264#p204264
Thus I can take bookmarks like this: and if I put a regular expression to just match the number at the beginning (ie with the settings shown on the image of the tool dialog above), it will number pages using just the matching part. ie, for 06.1 the pages would be numbered
06.1.1, 06.1.2, 06.1.3, ...
and the next section 07.0 would be
07.0.1, 07.0.2, ....
etc
Changes in v2.0
- add regex to set label;
- option to add number;
- add progress dialog when looking for current page bookmark;
- new dialog for label from bookmarks
You do not have the required permissions to view the files attached to this post.
Last edited by Mathew on Tue Jul 14, 2026 3:01 pm, edited 1 time in total.
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Thank you, Mathew, for this enhancement. Beyond you and me, I am sure that many PDFXCE users will benefit and appreciate what you have done although it may have ruined your weekend. I had the feeling that I could hear the wheels churning from your region as you grappled with the challenge.
It may be obvious but that won't prevent me from stating the following. With this tool, users can now 'incrementalize' (if there is such a word) files and easily produce new updated Page Labels, or 'Titles'. By 'incrementalize', I mean add new pages to pre-existing file perhaps as new data pages are inserted. In other words, this addresses your, Mathew, FR regarding saving page labels viewtopic.php?t=49803.
Again, a huge Thank You!
It may be obvious but that won't prevent me from stating the following. With this tool, users can now 'incrementalize' (if there is such a word) files and easily produce new updated Page Labels, or 'Titles'. By 'incrementalize', I mean add new pages to pre-existing file perhaps as new data pages are inserted. In other words, this addresses your, Mathew, FR regarding saving page labels viewtopic.php?t=49803.
Again, a huge Thank You!
All best,
FringePhil
FringePhil
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Sorry, but I'm feeling a bit brain-dead at the moment...I have forgotten how to link a tool icon to a java script, like in this case. I have replaced the prior version of the applyBkNametoLabel script in the JavaScript folder but I am stuck because I cannot remember what to do next. So, when I click on the corresponding tool icon, it runs v1.1, not v2.0. What am I doing/not doing wrong?
All best,
FringePhil
FringePhil
-
Mathew
- User
- Posts: 855
- Joined: Thu Jun 19, 2014 7:30 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Not you at all: I suspect it’s the same head scratcher I ran into: v11 of PXCE moved where the JavaScript folder is. They left the old one and copied everything to the new one. Very confusing.PHK wrote: ↑Tue Jul 14, 2026 10:21 am Sorry, but I'm feeling a bit brain-dead at the moment...I have forgotten how to link a tool icon to a java script, like in this case. I have replaced the prior version of the applyBkNametoLabel script in the JavaScript folder but I am stuck because I cannot remember what to do next. So, when I click on the corresponding tool icon, it runs v1.1, not v2.0. What am I doing/not doing wrong?
For PDFX-Change before version 11:
%APPDATA%\Tracker Software\PDFXEditor\3.0
Version 11 onwards, the folder moved:
%APPDATA%\PDF-XChange\PDF Editor
-
Mathew
- User
- Posts: 855
- Joined: Thu Jun 19, 2014 7:30 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
PHK wrote: ↑Tue Jul 14, 2026 8:49 am Thank you, Mathew, for this enhancement. Beyond you and me, I am sure that many PDFXCE users will benefit and appreciate what you have done although it may have ruined your weekend. I had the feeling that I could hear the wheels churning from your region as you grappled with the challenge.
In other words, this addresses your, Mathew, FR regarding saving page labels viewtopic.php?t=49803.
You’re right: I think this approach that you suggested is actually much better than what I’d envisioned with my feature request because it completely automated the page numbers. I think it cut down a rather painful meticulous process into two easy steps, given that I name the files already with the numbering: merge the documents then run this tool. I add a step after to add headers and footers but I can use the page labels for the page numbers in those so that is also easy (I used to do it individually for each section before combining).
-
Sean - PDF-XChange
- Site Admin
- Posts: 1097
- Joined: Wed Sep 14, 2016 5:42 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Actually, I have been doing something similar although in a completely different field: legal documents. Legal filings and court documents traditionally are formatted in an hierarchical outline framework over as many pages as it takes, frequently into the hundreds of pages. I de-paginate the content and show the content in the source three-dimensional outline. I gather all footnotes into one vertical page (rarely breaking it down into multiple columns to fit them into restricted space as below) which I stamp onto the document sheet as part of the finalization process. I adopt the outline titles as Bookmarks which become very important navigational devices.
As an example, this was about fifty pages.
I then build a file, document by document, using the Combine Files tool. Each parent Bookmark is [yy-mm-dd] and a short text title. And the child Bookmarks are carried into the merged sheet from the original one-page[sheet] file. Using v1.1, the Page titles in the Thumbnails panel were a bit long, mostly not visible. V2.0 solves this for me. So now, page titles can be only the date without the text clutter.
In this way I can see all the important documents relating to a single case in a single file and I can navigate from document to document and page to page using Bookmarks and I create new sheets and combine them into the matter file using the Combine files tool as they come along. I can also create Comments that relate to single issues but range over many documents/pages. In this fashion, not only am I avoiding having to jump from page to page but also avoiding going from file to file, making everything vastly more comprehendable more quickly.
You do not have the required permissions to view the files attached to this post.
Last edited by PHK on Tue Jul 14, 2026 5:07 pm, edited 3 times in total.
All best,
FringePhil
FringePhil
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Ah, yes, I forgot about that "enhancement" and this is the first time it has come up for me.Mathew wrote: ↑Tue Jul 14, 2026 2:44 pm
Not you at all: I suspect it’s the same head scratcher I ran into: v11 of PXCE moved where the JavaScript folder is. They left the old one and copied everything to the new one. Very confusing.
For PDFX-Change before version 11:
%APPDATA%\Tracker Software\PDFXEditor\3.0
Version 11 onwards, the folder moved:
%APPDATA%\PDF-XChange\PDF Editor
All best,
FringePhil
FringePhil
-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
OK, Mathew, I've got V2.0 working but I am not up on how to set the parameters.
Simply put, your example above doesn't (and shouldn't, I expect) work for the formats I am using.
Which is yy-mm-dd, like today is 26-07-14 (Happy Bastille Day!)
What parameter set should I employ?
Simply put, your example above doesn't (and shouldn't, I expect) work for the formats I am using.
Which is yy-mm-dd, like today is 26-07-14 (Happy Bastille Day!)
What parameter set should I employ?
All best,
FringePhil
FringePhil
-
Mathew
- User
- Posts: 855
- Joined: Thu Jun 19, 2014 7:30 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Regular expressions take a bit to learn. For your date format above (if that's all you wanted to match - allowing for one or two digits at month and day):PHK wrote: ↑Tue Jul 14, 2026 4:46 pm OK, Mathew, I've got V2.0 working but I am not up on how to set the parameters.
Simply put, your example above doesn't (and shouldn't, I expect) work for the formats I am using.
Which is yy-mm-dd, like today is 26-07-14 (Happy Bastille Day!)
What parameter set should I employ?
Code: Select all
\d{2}-\d{1,2}-\d{1,2}-
Mathew
- User
- Posts: 855
- Joined: Thu Jun 19, 2014 7:30 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
if it's always 2 digits at each, simpler:
or easier to understand (\d means a numerical digit 0-9)
Code: Select all
\d{2}-\d{2}-\d{2}Code: Select all
\d\d-\d\d-\d\d-
PHK
- User
- Posts: 1599
- Joined: Tue Nov 24, 2020 4:02 pm
Re: 386 Feature Request: Apply Bookmark to Page Label
Ah, thank you, Mathew, that works beautifully!Mathew wrote: ↑Tue Jul 14, 2026 7:19 pm if it's always 2 digits at each, simpler:or easier to understand (\d means a numerical digit 0-9)Code: Select all
\d{2}-\d{2}-\d{2}Code: Select all
\d\d-\d\d-\d\d
All best,
FringePhil
FringePhil