[FR] Combining documents: Option whether to save page labels

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
Mathew
User
Posts: 855
Joined: Thu Jun 19, 2014 7:30 pm

[FR] Combining documents: Option whether to save page labels

Post by Mathew »

I often need to combine a large number of pdfs to make a single document. Two ways I'm aware of:
  1. New Document > Combine Files into a Single Document. This works very well, and has the option to add bookmarks for each document;
    image.png
    however, it seems to strip out any page labels I have added to the individual files and makes the whole file a single label group:
    image(1).png
  2. The only way I can see to save page labels is to use Document > Insert Pages. For this method, I need to manually add the bookmark to the first document:
    image(2).png
    but the page labels are preserved:
    image(3).png
The options are the same for both tools (except for the extra blank page option that would not make sense for the insert pages), but I see nothing about page labels:
image(4).png
The second way is very laborious for inserting many documents. Maybe it's a PDF Tools option, but I don't have that. My request is one option in the above options dialog to Preserve Page Labels for inserted documents (or combined documents).

Related: If a range of page numbers has been added to a document, and a document is inserted within that range, the range gets terminated on each side of the newly inserted page, and continues after it:
Doc 1: G1, G2, G3, G4, G5
Doc 2: H1, H2, H3, H4, H5
If Doc 2 is inserted after Doc 1 page 2, one gets:
G1, G2, H1, H2, H3, H4, H5, G3, G4, G5
This is exactly how I would expect it to act for "Preserve Page Labels" for my desired option in the insert tool.

If that option were off, I'd expect the inserted document to fit into the previously defined range (ie the labels on the inserted document get dropped), so page numbering in the resulting document would be G1, G2, G3 .... G9, G10
You do not have the required permissions to view the files attached to this post.
User avatar
PHK
User
Posts: 1599
Joined: Tue Nov 24, 2020 4:02 pm

Re: [FR] Combining documents: Option whether to save page labels

Post by PHK »

Hi, Mathew. Like you, I am frequently combining bookmarked files. And I love to use your Label from Bookmark tool.

So, when I combine files and lose the page labels, I simply use the Label from Bookmark tool and the 'Pick bookmarks to relable pages' option to recreate. Does that not work for you?
All best,

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

Re: [FR] Combining documents: Option whether to save page labels

Post by Mathew »

PHK wrote: Tue Jul 07, 2026 9:09 am So, when I combine files and lose the page labels, I simply use the Label from Bookmark tool and the 'Pick bookmarks to relable pages' option to recreate. Does that not work for you?
The files I’m combining are generally structural calculation packages. So I’m using the page label similarly to hierarchical list numbers, ie 1.0, 2.0, etc for each section but then within that section each page will be numbered 1.1, 1.2, etc. There are frequently sub-sub sections 1.2.1, 1.2.2, etc. Bookmarks will generally be for the beginning of a section but I don’t generally include the section number in the bookmark. But I guess I could; and then strip out the text part so that the labels can continue numbering: that may be a workaround. Thanks
User avatar
rakunavi
User
Posts: 2230
Joined: Sat Sep 11, 2021 5:04 am

Re: [FR] Combining documents: Option whether to save page labels

Post by rakunavi »

Hello Mathew,
Mathew wrote: Mon Jul 06, 2026 11:26 pm The only way I can see to save page labels is to use Document > Insert Pages. For this method, I need to manually add the bookmark to the first document:
After experimenting further, I tried a different approach regarding the second method you kindly introduced.
If I first create a blank dummy document, insert the two documents into it, and then delete the initial blank dummy page, a bookmark is indeed added to the root of the first document. Since the entire process can be completed using only shortcuts, it might even be possible to automate it with something like AutoHotkey, depending on the situation.

  • Animation.gif
  • SampleFiles.zip
It feels almost too embarrassingly clumsy a method to present to someone as exceptionally skilled as you, Mathew—especially given the brilliant JavaScript you generously share on the forum. Still, since I ended up making a video of it :lol: , I will upload it here with full awareness that it is unlikely to be of any real use, but just in case it offers some small reference.

Best regards,
rakunavi
You do not have the required permissions to view the files attached to this post.
Top needs 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 FullScrnMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Mathew
User
Posts: 855
Joined: Thu Jun 19, 2014 7:30 pm

Re: [FR] Combining documents: Option whether to save page labels

Post by Mathew »

rakunavi wrote: Tue Jul 07, 2026 9:38 pm If I first create a blank dummy document, insert the two documents into it, and then delete the initial blank dummy page, a bookmark is indeed added to the root of the first document. Since the entire process can be completed using only shortcuts, it might even be possible to automate it with something like AutoHotkey, depending on the situation.
:shock: Two perfectly good solutions; one even uses one of the tools I posted. :oops:

The reason I brought up the topic is I suspect both the insert pages and the combine documents tool use the same functions "under the hood", but there's a hidden setting that makes them work inconsistently from one another when there are page labels. While I'm in full agreement that "settings bloat" is problematic, I think this setting is something that should be available not hard-coded.
User avatar
PHK
User
Posts: 1599
Joined: Tue Nov 24, 2020 4:02 pm

Re: [FR] Combining documents: Option whether to save page labels

Post by PHK »

Mathew wrote: Tue Jul 07, 2026 3:09 pm ... Bookmarks will generally be for the beginning of a section but I don’t generally include the section number in the bookmark. But I guess I could; and then strip out the text part so that the labels can continue numbering: that may be a workaround. Thanks
Hi, Mathew, I am assuming your titles look something like this.
image.png
If so, may I suggest the following?

When creating the PDFXCE Bookmarks, give the numeric element its own BM and the descriptive text its own, but as a 'junior' or 'child', BM. I have made the first page '0.0' to keep the pagination correct but it could be any text.

Then, when you run your 'Label from Bookmark' tool, using the 'Pick bookmarks to relable pages' option, only the numerical BMs will be page labels.

image(2).png
image(1).png
And, if the descriptive text is set as a destination,

image(3).png

clicking on either the numeric or the alpha Bookmark will pull up the corresponding page.
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil