How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

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

MedBooster
User
Posts: 1372
Joined: Mon Nov 15, 2021 8:38 pm

How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by MedBooster »

How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

referring to a main bookmark, with their subbookmarks, but not others

my workaround is exporting all bookmarks, deleting the extra ones, creating the table of contents, and then importing them all manually again
image.png
the issue with this method is that now my links in the table of contents are going to the correct page.... but after importing the bookmarks themselves (which are the basis of the table of contents) back into PDF-xce they got skewed a couple of pages, probably because of the 5 extra table of content pages
You do not have the required permissions to view the files attached to this post.
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
Willy Van Nuffel
User
Posts: 2746
Joined: Wed Jan 18, 2006 12:10 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by Willy Van Nuffel »

@MedBooster
Would it help to insert 5 empty pages before exporting the bookmarks and remove them after the export ?

@PDF-XChange Support
Maybe an additional option in the "Build table of contents (from bookmarks)" dialog-box, in the zone "Bookmarks", could be "Use selected bookmarks" ?

Kind regards.
MedBooster
User
Posts: 1372
Joined: Mon Nov 15, 2021 8:38 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by MedBooster »

Willy Van Nuffel wrote: Thu Nov 23, 2023 8:11 am @MedBooster
Would it help to insert 5 empty pages before exporting the bookmarks and remove them after the export ?

@PDF-XChange Support
Maybe an additional option in the "Build table of contents (from bookmarks)" dialog-box, in the zone "Bookmarks", could be "Use selected bookmarks" ?

Kind regards.

The main issue is that....
If you have page
1
2
3

and you want to insert a table of contents between 1 and 2... the bookmarks get skewed the exact amount of pages as the quantity of table of content-pages are added...

This wouldn't be an issue if adding table of contents wouldn't skew bookmark positions of bookmarks of pages after the table of contents


https://forum.pdf-xchange.com/viewtopic.php?t=41085
Last edited by MedBooster on Thu Nov 23, 2023 8:43 am, edited 1 time in total.
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
Willy Van Nuffel
User
Posts: 2746
Joined: Wed Jan 18, 2006 12:10 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by Willy Van Nuffel »

Thank you @MedBooster for clarifying that. It seems like you aim to insert a table of contents per chapter.

Hopefully this is something that can be resolved soon by PDF-XChange development.

Regards.
MedBooster
User
Posts: 1372
Joined: Mon Nov 15, 2021 8:38 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by MedBooster »

Willy Van Nuffel wrote: Thu Nov 23, 2023 8:40 am Thank you @MedBooster for clarifying that. It seems like you aim to insert a table of contents per chapter.

Hopefully this is something that can be resolved soon by PDF-XChange development.

Regards.
Yes, am I wrong for calling it bookmark folders?
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
Willy Van Nuffel
User
Posts: 2746
Joined: Wed Jan 18, 2006 12:10 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by Willy Van Nuffel »

For me, you can call them bookmark folders.

I think it is a clear now what you like to ask:
1) being able to create a table of contents based on a specific part of the bookmarks branch
2) resolve the wrong destination of the bookmarks after inserting a table of contents

Regards.
MedBooster
User
Posts: 1372
Joined: Mon Nov 15, 2021 8:38 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by MedBooster »

Willy Van Nuffel wrote: Thu Nov 23, 2023 9:35 am For me, you can call them bookmark folders.

I think it is a clear now what you like to ask:
1) being able to create a table of contents based on a specific part of the bookmarks branch
2) resolve the wrong destination of the bookmarks after inserting a table of contents

Regards.
A very precise and concise description of what I am inquiring about, thank you.
My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11094
Joined: Wed Jan 03, 2018 6:52 pm

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by Daniel - PDF-XChange »

Hello, MedBooster

When you export bookmarks, the current page number is recorded, so a bookmark on page 1 will be imported still pointint o page 1, even if the content of the exported page 1 has moved to page 5 because of a ToC being added. So what you describe there is expected. Willy's suggestion to add blank pages (at the same length of your ToC) before exporting would prevent this issue, as the later import (after deleting the blank sheets and then adding in the ToC) would then be pointing to the correct pages.

Moving past that, the ability to create a ToC from a small selection of bookmarks would be quite beneficial, and I am passing this up the chain for review. Hopefully we can see this implemented in the future.
(I have also included the suggestion that when importing bookmarks, we should be able to manually define the "first page" and have all bookmarks follow that adjustment during the process. This one is likely much more complicated and I cannot make any promises for an implementation)

Now, regarding the second point, as willy phrased it: "resolve the wrong destination of the bookmarks after inserting a table of contents"... I am still as of yet unsure what you mean here? The only time that bookmarks seem to have an "incorrect" location after adding a ToC, is when importing the bookmarks without following the advice outlined above.

[Update, 2 tickets made!]
RT#6708: FR: Add "selected bookmarks" option for "Build Table of contents" tool.
---(Rejected)---RT#6709: FR: "Import bookmark controls"---(Rejected)---


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: 1689
Joined: Sat Sep 11, 2021 5:04 am

Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

Post by rakunavi »

Hello MedBooster,

As before, this probably won't be of any use to you, but I will show you the procedure I would take in the situation you have indicated.

I will use the PDF manual of PDF-XCE as an example because it is easier to explain.

In the actual verification, the file size was reduced by removing all images. I have attached a sample file along with the output file after the table of contents has been generated for your reference. This is to avoid overloading the network and server, and also in consideration of future users who may view this topic by search. In case of copyright issues, please delete the file by Tracker Support.

  • SampleFiles.zip
The procedure for creating a table of contents for the section '5.1 File Tab' starting on page 77 is as follows.

  • figure.png
  1. Find out the level of the deepest bookmark entry in the '5.1 File Tab' section for which you want to create a table of contents. In this example, it is the fourth level. You can open the bookmarks pane to examine them, or if the number of levels is deep, you can export the bookmarks to a text file and then count the number of tabs in a text editor or similar program.
    • Select the current bookmark with Ctrl+A and then copy it with Ctrl+C.
      • Create a new entry under the appropriate entry at the 4th level of the '5.1 File Tab' section and lower the entry level by one to the 5th level. In the video, a 6th-level entry is created to make it easier to explain.
        • With the focus on the newly created 6th level item, paste all bookmarks using Ctrl+V. Then, delete the dummy 6th level item.
          • In the bookmarks pane, drag bookmarks under the '5.1 File Tab' section to the top level.
            • Delete all items from your bookmarks except for the '5.1 File Tab' section where you want to create a table of contents.
              • Open the 'Build Table of Contents' dialog.
                • Uncheck 'Use all bookmarks levels' and set 'First bookmark level to include in TOC' to 1 and 'Last bookmark level to include in TOC' to 3. Note that the number of levels checked in Step 1 is 4, but the 'Last bookmark level to include in TOC' is 3 (4 minus 1) because '5.1 File Tab' was moved by one level to the top level in Step 5.
                  • Specify page 84 as the insertion point for the table of contents. Incidentally, the title of page 84 is '5.1.1.2 Sessions'.
                    • Build the TOC.
                      • After copying the bookmark pasted in Step 4, delete the entire bookmark and finally paste the bookmark.
                      For reference, the following video shows the sequence of procedures.

                      • Animation.gif
                      In the above procedure, I did nothing because the total number of pages in the inserted table of contents is even (two pages), but if it is odd, one blank page can be added before and after the table of contents to maintain the odd-even page relationship when the pages are displayed as a two-page spread for the pages after the table of contents.

                      In short, in order to have the application automatically correct the destination page of the bookmark that changes as the table of contents is added, the entire original bookmark must inevitably be stored somewhere in the bookmark. However, since you do not want the generated table of contents to reflect this, you will have no choice but to set a lower limit on the number of levels of hierarchy in which the table of contents can be generated, and temporarily place it in a deeper level of hierarchy than that to exclude it from the 'Build Table of Contents' feature.

                      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
                      MedBooster
                      User
                      Posts: 1372
                      Joined: Mon Nov 15, 2021 8:38 pm

                      Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

                      Post by MedBooster »

                      Even if it would not be useful to me (which I doubt) I am sure it would prove useful to someone else.
                      Thank you, you're the GOAT! :)
                      My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
                      Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
                      User avatar
                      Daniel - PDF-XChange
                      Site Admin
                      Posts: 11094
                      Joined: Wed Jan 03, 2018 6:52 pm

                      How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

                      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
                      Daniel - PDF-XChange
                      Site Admin
                      Posts: 11094
                      Joined: Wed Jan 03, 2018 6:52 pm

                      Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

                      Post by Daniel - PDF-XChange »

                      Hello,

                      Just a quick update on this, Ticket #6709 has been rejected. In lieu of a change there, this was the response from the developers:
                      There is already a more reliable solution to this problem.
                      Before exporting bookmarks, the user needs to use "Bookmarks --> Convert to Named Destinations" tool. Then export bookmarks.
                      Next time when the user imports these bookmarks, they will already point to necessary pages in spite of any document changes, because the "destination names" are in use.
                      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
                      MedBooster
                      User
                      Posts: 1372
                      Joined: Mon Nov 15, 2021 8:38 pm

                      Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

                      Post by MedBooster »

                      What I find strange is that even if you generate a bookmark table of contents with only "level 1" formatted, other sub-bookmarks are somehow also inserted as level 1.

                      Is there still no way to toggle off redundant levels?
                      It would be nice if you could somehow toggle an option like this on and off.

                      E.g. if you have 3 levels of bookmarks (maximum sub-sub-bookmark) you would not generate the level 4 bookmarks.

                      Does this make sense?
                      My wishlist https://forum.pdf-xchange.com/viewtopic.php?p=187394#p187394
                      Disable SPACE page navigation, fix kb shortcut for highlighting advanced search tool search field, bookmarks with numbers, toolbar small icon size, AltGr/Ctrl+Alt keyboard issues
                      User avatar
                      Daniel - PDF-XChange
                      Site Admin
                      Posts: 11094
                      Joined: Wed Jan 03, 2018 6:52 pm

                      Re: How do I build a table of contents from just 1 "branch" of bookmarks and not all of them?

                      Post by Daniel - PDF-XChange »

                      Hello, MedBooster

                      I think that these controls are the ones you are looking for?
                      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