386 Feature Request: Apply Bookmark to Page Label

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

User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Thank you for adding the Page Label property option. I love it already. But it has stimulated another wanna-have.

I can see myself labelling pages directly from Bookmarks. Now, I have to F2 the Bookmark, copy it, go back to the page in the thumbnails panel and paste that into the Label block of Properties. Wouldn't it be so much easier if there were a Bookmark tool or option to 'automatically' apply the Bookmark title to the Page Label?

And the reverse? Create Bookmark titles from Page Labels?

You opened a can of worms with this new feature, didn't you?
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Stefan - PDF-XChange »

Hello PHK,

A Bookmark is not required to point to a specific page. It could be opening a web link or executing some JS and then going to a page, so I do not see that Feature request as an easy one to approve by our devs, however I will ask about their thoughts on it!

Kind regards,
Stefan
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Sorry, but perhaps I was not sufficiently clear: I only want the TEXT of the Bookmark Title to be the Title of the Page.

I understand and respect the variety of actions a Bookmark can perform.

I hope this is easier to accomodate.
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Stefan - PDF-XChange »

Hello PHK,

Yes - I understood your request - however a bookmark technically can be pointing only to a n external resource and no page in the file it is in. It's also possible to have more than one bookmark pointing to the same page (and maybe different parts on it) - e.g. if you have a heading at the start of the page and then 2-3 subheadings on the same page - each with their own bookmark.

So there are quite a few nuances to be considered here, and as such it might be rejected, and you could need to continue to copy those bookmark names manually.

Kind regards,
Stefan
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Stefan - PDF-XChange »

Hello Phil,

Got an approval for that FR - and here is the ticket for it:
#6892: FR: Editor 386 - Apply Bookmark to Page Label

Kind regards,
Stefan
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Thank you, Stefan, for passing that on. I am sure it will be a useful addition to the product.
All best,

FringePhil
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

386 Feature Request: Apply Bookmark to Page Label

Post by Stefan - PDF-XChange »

:)
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

PHK wrote: Wed May 01, 2024 2:56 am And the reverse? Create Bookmark titles from Page Labels?

You opened a can of worms with this new feature, didn't you?
I just realized that creating bookmarks from page labels (ie the reverse) is already here: It doesn't check whether a page label exists, so we need to manually set the page range to create bookmarks from, but:
image.png
If javascript were able to set and get page labels properly, it would be easy to do with javascript. Unfortunately... viewtopic.php?p=192109#p192109
You do not have the required permissions to view the files attached to this post.
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Thank you for commenting on this topic, Mathew, and raising my awareness of the depth of options available in Bookmarks.

However, I do not think that is the sort of use I was trying to resolve. Rather than a series of multiple pages that need to have the Bookmarks in sync with the Page Labels, I am thinking about unique (one-off) bookmark/page label pairings. For instance, if the document is a series of paragraphs organized in a conventional outline format (I., A., 1., a., etc.) with a headline for each section (i. e., "I, Introduction", "II. Background", etc.), then I want to have the pages to be those sections (can be multiple paragraphs merged into individual section pages) with my page labels and their respective bookmarks to be the same. I say "same" but I may want to edit the page labels in the cause of brevity for Thumbnail-viewing space considerations.

Stepping back to appreciate the 'big picture' of what I am trying to achieve is this: I am convinced the legacy conventional page formats (A4, letter, legal, etc.) no longer meet most of our needs and, in a hundred years or less, will be viewed as a quaint anachronism. You don't see paper operating manuals on Starship Enterprise, do you? Readers today are increasingly unbound by legacy page constraints as any website page views clearly demonstrates. If you read a story on an online news source, you scroll down through the "page" until the content end without artificial page interruptions, don't you? Therefore, I am constantly merging downloaded pages to 'new' pages whose lengths are dictated by the document content rather than physical paper sizes. Obviously, this is for on-screen consumption rather than being formatted for re-publication on to physical paper (who does that any more?).

Indeed, I find it odd that https://help.pdf-xchange.com/pdfxe10/ is formatted for paper sizes rather than the content of the document, given the focus of the app. Has any user ever printed the manual?
All best,

FringePhil
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

PHK wrote: Wed Aug 13, 2025 8:43 am I am thinking about unique (one-off) bookmark/page label pairings. For instance, if the document is a series of paragraphs organized in a conventional outline format (I., A., 1., a., etc.) with a headline for each section (i. e., "I, Introduction", "II. Background", etc.), then I want to have the pages to be those sections (can be multiple paragraphs merged into individual section pages) with my page labels and their respective bookmarks to be the same. I say "same" but I may want to edit the page labels in the cause of brevity for Thumbnail-viewing space considerations.
hmmm, not sure I quite understand. Maybe this helps (I'm not sure if it's exactly what you're looking for):

I made a script that copies the current page bookmark to the current page label. It also has a button to do the reverse.

It adds a menu item "Label from Bookmark" to the Bookmarks menu/ribbon.
image.png
The script has two ways of operating:
  • If Ctrl is held down while calling the script (ie the default keyboard shortcut Ctrl+F2 or hold down Ctrl while clicking the menu item) then it immediately renames the label. It will give a dialog asking which bookmark to use if more than one bookmark point to this page.
  • Otherwise it pops up a dialog with two options:
    image(1).png
It also adds its inverse: A menu item "Name from Label" to the Bookmarks menu/ribbon.
image(2).png
Again, it has two ways of operating:
  • If Ctrl is held down while calling the script (there is no default keyboard shortcut - it can be assigned through "Customize Toolbars…" menu option), then it immediately renames the Bookmark using the current page label. It will give a dialog asking which bookmark to use if more than one bookmark point to this page.
  • Otherwise it pops up a dialog with the inverse of the above options:
    image(3).png
As usual, unzip and copy to %APPDATA%\Tracker Software\PDFXEditor\3.0\Javascripts
applyBkNameToLabel v1.1.zip



Limitations
  • Fixed build 398: As I pointed out in another forum post, the current (build 396) implementation of doc.setPageLabels doesn't allow one to omit page numbering, even if the pdf spec does (maybe we can get the developers to fix that :wink: ?) So the script currently sticks a number 1 on the back of the label - would need to manually remove that.
  • It checks which page a bookmark points to by running the script associated with each bookmark. This can be slow, and if a bookmark leads nowhere, the script will assume it points to the currently active page.

This is the first version I posted. It has only the first menu item described above, and uses Shift as the option key:
applyBkNameToLabel v0.3.zip
  • v0.3 2025-08-13 fix bug adding label to last page
  • v0.2 2025-08-13 Shift sets multiple bookmarks, optimize icon
  • v0.1 2025-08-13 initial version
You do not have the required permissions to view the files attached to this post.
Last edited by Mathew on Thu Aug 21, 2025 7:17 pm, edited 3 times in total.
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Many thanks, Mathew! That works very well and I can see it will have a positive impact on my efficiency. I appreciate the way it shows all Bookmarks that point to that page and allows the user to select one. Pity about the " 1" suffix but I can live with that. It's too bad there isn't a Find and Replace tool that operates on page labels the way it does on Bookmark titles.

I don't suppose a tool that does the reverse complimentary (page label to Bookmark title) would be as easy to create...
All best,

FringePhil
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

:) I’m glad it helps. I’ve posted a FR for doc.setPageLabels.
PHK wrote: Thu Aug 14, 2025 9:12 am I don't suppose a tool that does the reverse complimentary (page label to Bookmark title) would be as easy to create...
Doesn’t “Bookmark every Nth page” do that already? Or are you looking for a tool that finds the bookmarks pointing to the current page and assigns the page label to (one of) them?
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

Hello, Mathew & PHK
PHK wrote: Thu Aug 14, 2025 9:12 am Pity about the " 1" suffix but I can live with that.
I have just passed Mathews' request along to the dev team, so perhaps this may be possible in the future! :)

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
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Mathew wrote: Thu Aug 14, 2025 3:14 pm :) I’m glad it helps. I’ve posted a FR for doc.setPageLabels.
PHK wrote: Thu Aug 14, 2025 9:12 am I don't suppose a tool that does the reverse complimentary (page label to Bookmark title) would be as easy to create...
Doesn’t “Bookmark every Nth page” do that already? Or are you looking for a tool that finds the bookmarks pointing to the current page and assigns the page label to (one of) them?
I am talking about unique, not serial, page labels. Your tool does that very well for taking a Bookmark Title and creating a matching Thumbnail "Subject" or title or name, whatever you want to call it that is visible in the Tumbnails panel below the respective Thumbnail so long as Thumbnails are toggled to "Use Logical Page Numbers" even if, strictly speaking, they are not necessarily exclusively 'numbers'.

What I was talking about earlier is the reverse equivalent, i. e., taking the Logical Page Number (hereinafter 'name') and that would be the basis for creating a new Bookmark that points to the subject page. So the current keystroke sequence would be:

  • activate (rename) the text string of the page name in the Thumbnails panel,
  • copy it (ctrl-C),
  • deactive (close rename),
  • create a new Bookmark,
  • paste the copied name (ctrl-V) into the Bookmark title, and
  • hit enter to finalize.
This assures the page names agree with the Bookmarks. I concede this is not difficult to do 'manually' now, just repetitively inefficient.
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

Hello, PHK

So, like Mathew suggested, the "bookmark every nth page" function would be able to do this, no?
image.png
Kind regards,
You do not have the required permissions to view the files attached to this post.
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
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

My apologies, Daniel and Mathew, I had been completely unaware of that function and discounted it without appreciating what it can do! And, yes, it does work and I have added to my Bookmarks Options drop-down list.

One thing about the number suffix that gets automatically added: it is not necessarily a bad thing and should be retained as an option. The way it works is to act as if you are in the Page Numbering tool and adding a new range with the Bookmark title inserted as the Prefix and you are starting numbering page sequence from one and on. This might be desirable in some situations, for instance if there are multiple pages in a section with a single Bookmark title. So don't 'throw that baby out with the bathwater' as they say.
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

Hello, PHK

That would be up to Mathew (or yourself, if you feel like adding a single letter to the script).
image.png
My understanding is adding a digit is already functional with one of the variables ("D" as per the image above), the only bug to be fixed there, is that not providing any variable, as Mathew's current script does, should result in no number appearing, while currently, a number does appear.

Also, if you wish to do so, you can use the "sequential number" macro in the existing UI:
image(1).png
Kind regards,
You do not have the required permissions to view the files attached to this post.
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
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

My gosh, does one ever stop learning with this app?? Thanks for those insights, Daniel.

My next question is "how do I change the hot-key assignment for an add-on like Label From Bookmark"?
All best,

FringePhil
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

... and given all that, I couldn't resist and came up with another version last night that has two separate menu options:
image.png
Label from Bookmark
  • This sets the page label from bookmark name (the original version). However, I've changed that if you hold down Ctrl while calling the script, it immediately does the label change. BUT if you click the menu item without Ctrl held down, then it pops up a dialog giving two options:
    image(1).png
image(2).png
Name from Label
  • This is the inverse as FringePhil was talking about above. It does not create a new bookmark, just renames it based on the current page label. Again, if Ctrl is held down while calling, it just does the renaming. Otherwise, (without Ctrl held down) it gives a dialog with two options:
    image(3).png
Here's the revised version:
applyBkNameToLabel v1.0.zip
Changes in v1.0
  • change to Ctrl as modifier and it brings up a menu to choose which option;
  • add invert() function that applies page label to bookmark(s);
  • add second parameter to allow the Ctrl option to be called directly;
  • multi-bookmark relable only relables with the first bookmark found;
  • add sub-menu to break out page labels

PHK wrote: Fri Aug 15, 2025 8:24 am My next question is "how do I change the hot-key assignment for an add-on like Label From Bookmark"?
Go to Customize Toolbars…
image(4).png
Right click on the menu item you want to change the shortcut, and select properties:
image(5).png
Change the shortcut in the tool properties:
image(6).png
You do not have the required permissions to view the files attached to this post.
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Many thanks, Mathew for the enhanced tools and advice on hot-keys. With respect to the latter, I looked for the tools in the Commands section of Customizing tools but realized that properties of external add-ons were not alterable there and I certainly did not know of right-click approach. Thank you.

And I like the pair of new tools for BMs/TNs a whole lot. I note that one way of solving the page sequencing suffix problem is to start with the TN title (providing, of course, there is a pre-existing BM) and then using the new NFL tool to alter the BM. It may be slightly easier than manually deleting the suffices.
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

:)
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
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Mathew wrote: Fri Aug 15, 2025 3:04 pm ...
BUT if you click the menu item without Ctrl held down, then it pops up a dialog giving two options:
...
It seems if you do this, you don't get the numerical suffix which is nice.
All best,

FringePhil
User avatar
Dimitar - PDF-XChange
Site Admin
Posts: 2432
Joined: Mon Jan 15, 2018 9:01 am

386 Feature Request: Apply Bookmark to Page Label

Post by Dimitar - PDF-XChange »

:)
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

PHK wrote: Sat Aug 16, 2025 7:49 am
Mathew wrote: Fri Aug 15, 2025 3:04 pm ...
BUT if you click the menu item without Ctrl held down, then it pops up a dialog giving two options:
...
It seems if you do this, you don't get the numerical suffix which is nice.
Actually, I am finding this not to be true in all cases but I have not yet been able to differentiate between those that do and those that don't.
All best,

FringePhil
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

[edit] As of PXCE 10.7 the script can set page labels without a number.

JavaScript is unable to set the page label without a number. One can format that number as Arabic, Roman or Alphabetical; but if the script is setting a page label it will have a number after it.

Adobe stopped developing JavaScript for PDF a long time ago, so it has quite a lot of partially thought-through stuff. Bookmarks, page labels and links are particular examples. To their credit they put together an API and posted it publicly. PDF Xchange have been picking up some of the most glaring deficiencies and making it work better in their application. Hopefully this will be another of them
Last edited by Mathew on Thu Aug 21, 2025 8:38 pm, edited 2 times in total.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

Hello, Mathew

8)
Daniel - PDF-XChange wrote: Thu Aug 14, 2025 3:24 pm (update - the dev team said they will try to add handling of empty strings here for 10.7)
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
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

I have been having fun labelling pages with their corresponding Bookmarks! I have a document with a couple thousand pages with Bookmarks for most of them. Using Ctrl-All with one click and the machine takes over. It is quite amusing to see the machine rapidly process all these and end up with all the pages labelled.

Again, many thanks Mathew for this useful, useful tool.
All best,

FringePhil
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by Mathew »

:D

As of PXCE 10.7 (build 398), v1.1 of this tool won't add a number to the end of the page label, either! That was fast: Thank you PDF XChange!
If you re-run the tool on the same bookmarks, it will relabel pages without the number suffix it added before.
applyBkNameToLabel v1.1.zip
Changes in v1.1
  • only enable menu item if there are bookmarks;
  • set label without number (build 398+)
You do not have the required permissions to view the files attached to this post.
User avatar
PHK
User
Posts: 1456
Joined: Tue Nov 24, 2020 4:02 pm

Re: 386 Feature Request: Apply Bookmark to Page Label

Post by PHK »

Beautiful! Simply Beautiful.

Thank you, Mathew.
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11586
Joined: Wed Jan 03, 2018 6:52 pm

386 Feature Request: Apply Bookmark to Page Label

Post by Daniel - PDF-XChange »

:)
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