[Feature Improvement] Generate Bookmarks from Page Text

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
netsonicyxf
User
Posts: 67
Joined: Sun Jul 01, 2012 2:19 pm

[Feature Improvement] Generate Bookmarks from Page Text

Post by netsonicyxf »

  • The current generated bookmark only has one level, is it to possible to generate multi-level bookmark?
  • The online help section of "Bookmark Generation Properties - Text Matching Options - Match Text Pattern" need to give detailed description which regex expression is supported in the Match Text Pattern.
  • "Bookmark Generation Properties - Text Matching Options - Match Text Pattern" give me some incorrect bookmarks
    e.g. I have the following text in a pdf
    1.1 text
    1.2 text
    1.2.1 text
    1.2.2 text
    2.1 text
    2.1.1 text
    2.2 text

    I tried to use "\d\.\d\s" to match these titles with 2-digits, but it generated bookmarks with 2- and 3-digits.
    1.1
    1.2
    1.2.1
    1.2.2
    2.1
    2.1.1
    2.2

    The generated bookmarks has only number part, text parts are cut off.
  • It's better to add an option: the generated bookmark should
    add before existing bookmarks,
    add after existing bookmarks,
    insert at user specified location
    replace the existing bookmarks
jimmarek
User
Posts: 3
Joined: Tue Oct 20, 2020 5:13 pm

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by jimmarek »

I agree that an option to clarify how the edited bookmarks are to be used would be helpful. I didn't realize that I was appending the revised selected bookmarks until I read your post.

I wanted the same result as you (only include text that started with 1 or 2 digit section numbers). For the subheadings, I used "\d\.\d.*", but when I entered it in the "Match Text Pattern:" field, I did not include the quotation marks. It worked as I hoped.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8439
Joined: Wed Jan 03, 2018 6:52 pm

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by TrackerSupp-Daniel »

Hi, jimmarek and netsonicyxf

We provide detials on how to create bookmarks from page text here:
https://help.pdf-xchange.com/pdfxe ... xt_ed.html
further details about all bookmarking functions can be found in the "bookmark tab" section of the manual:
https://help.pdf-xchange.com/pdfxe ... s2_ed.html

To create multi-level bookmarks, you simply need to add multiple levels of bookmark detection patterns to the dialog:
image.png
I hope this helps!

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
CONRADT
User
Posts: 1
Joined: Fri Feb 05, 2021 12:21 pm

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by CONRADT »

The "Generate Bookmarks from Page Text" instructions do not given an exacting explanation or an example of what should be entered in the "Match Text Pattern box". Can you explicitly define what goes in the field (with an example)?

I'm trying to generate bookmarks of the pattern: LName, FName (EmpNbr) MMDD-MMDD per diem

This information is found on each sheet as such (with critical data in Helvetica-Bold):

Employee: LName, FName (123456)

Description: 0101-0131 per diem


image.png
User avatar
Sean - Tracker
Site Admin
Posts: 175
Joined: Wed Sep 14, 2016 5:42 pm
Location: British Columbia

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by Sean - Tracker »

Hi Conrad,

Thanks for pointing out that this should be updated - I will add some further information about this next time the manuals are published. The regular expressions that this feature uses is ECMAScript. A complete breakdown of the available expressions is detailed here:

http://www.cplusplus.com/reference/regex/ECMAScript/

I hope this resolves the issue for you - if you have any further questions then please get in touch.

Best regards,
Sean Godley
Technical Writer
Tracker Software Products (Canada) LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
FLuser
User
Posts: 13
Joined: Thu Mar 18, 2021 7:00 am

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by FLuser »

@Sean - Tracker -
I think the reason for the confusion is that the regex pattern in the Bookmarks > From Page Text > Text Content Rules -- is broken. At least in current versions of PDF-Xchange 9.

I've spent a couple hours testing literally hundreds of regex patterns in v9 (build 350) and none of them work.

I've used the same text in the PDF, in an ECMAScript Regex evaluation/validator, and it works fine.

Continuing to try and understand the intermittent issues, I began testing simpler options. For example, static words.

For example, I might use a "pattern of" testword, then put "testword" in the document a dozen times. In some instances it might find one of them, in other instances with different words, it would never match.

This was after realizing that even the simplest of Regex functions would not work. For example, using a static string "test word", PDF-Xchange would never match. I would then test "test\sword" or "test[ ]word" or "test\Wword" or "tes[t\s]+word". None of those would match in PDF-Xchange, despite every one of those being valid ECMAScript, based on your recommendation.

Interestingly, it seems that after testing for a good deal of time, there is some sort of internal error in PDF-Xchange, because static-patterns that work (non-regex patterns) when first running the app, will no longer run, after many dozens of testing operations.

There are other errors in the Bookmarks-From-Page-Text feature, as well. For example, it may intermittently include text that matches whereas other times it will include only a portion of the text. To be clear, I'm well aware of the manner in which PDF files do not concatenate all text and I've eliminated this from the potential issues.

None of this requires a sample-file to reproduce. You can open any text and try things I've mentioned here, to reproduce. If you are unable to reproduce, let me know specifically what you've tested and I'll try this on my side, as well.

Thank you.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: [Feature Improvement] Generate Bookmarks from Page Text

Post by Tracker Supp-Stefan »

Hello FLuser,

It's been a while since your last post, and there have been a few more builds of our products.
Can you please update to build 358 and see if your RegEx works better with it?
If it does not - can you please send us a sample of a file and the regex you try to use on it that does not work as expected so that we can investigate this further?

Kind regards,
Stefan
Post Reply