Generate Bookmark from Table of Contents

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Nemo
User
Posts: 94
Joined: Mon Apr 20, 2020 12:23 pm

Generate Bookmark from Table of Contents

Post by Nemo »

I have a table of contents which lists the start and end pages of documents like this


Document Page(s)

DocumentA 1 - 6

DocumentB 6-10

It seems that X-change Editor cannot cope with this. It takes the last number (6 and 10 in the above example) as the start of the document and treats the first number and the dash as part of the name.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 12030
Joined: Wed Jan 03, 2018 6:52 pm

Re: Generate Bookmark from Table of Contents

Post by Daniel - PDF-XChange »

Hi, Nemo

This would be expected as a Table of contents is expected to be formatted similarly to the below
Title1 Page number
Title2...Page number
Title3---Page number
etc

It does not account for page ranges, but instead looks for a specific page number at the end of the line, and anything before that is considered to be the title. This is because Bookmarks cannot be applied to a page range, they can only have a single location stored. To accomplish this, you will want to reformat your Table of contents so that it only includes the Starting pages for each range on the end of the line.

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
Nemo
User
Posts: 94
Joined: Mon Apr 20, 2020 12:23 pm

Re: Generate Bookmark from Table of Contents

Post by Nemo »

Hi Daniel

Unfortunately I can't change the table of contents as it is generated by software.

Having a table of contents showing a page range (for multi-page items) is ````````````````````````````relatively common in my experience.

Would it be possible for PDF X-Change to be changed so that it is capable of recognising page ranges and using the first page number rather than the second?
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 12030
Joined: Wed Jan 03, 2018 6:52 pm

Re: Generate Bookmark from Table of Contents

Post by Daniel - PDF-XChange »

Hi, Nemo

While I cannot make any promises for implementation at this time, I have created a format feature request for you to hopefully add this in the future.
RT#5186: Generate Bookmarks from ToC to use Page ranges

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
Nemo
User
Posts: 94
Joined: Mon Apr 20, 2020 12:23 pm

Re: Generate Bookmark from Table of Contents

Post by Nemo »

Hi Daniel

Thank you.

Meanwhile I have been thinking about a temporary "workaround".

I have looked at the option you are presented with when using Generate Bookmark from Table of Contents
and there is an option named Add Links to the Table of Contents Entries.

I am not sure what this option is supposed to do (can't find any documentation) but what it actually seems to do is that if you select it it uses the hyperlink in the TOC to set the bookmark destinations and ignores the number which it detects at the end of the line. So using this option the bookmarks are generated with the correct destinations set. However...

For multipage documents (where there is an ending as well as a starting page in the index) the bookmark name ends up with a number at the end followed by a single space followed by a hyphen.

I see that there is a Find and Replace Bookmark Text button which has a Use Regular Expressions option. What would be a good regular expression to use to remove the number and hyphen from those bookmarks which have it?