Generate Bookmarks from Page Text
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
-
- User
- Posts: 84
- Joined: Mon Apr 20, 2020 12:23 pm
Generate Bookmarks from Page Text
When you use a text matching pattern it seems only to generate a single bookmark per page even if there are multiple matches on the page.
For example with a pattern of [A-Z][A-Z][A-Z][0-9]+ on a page containing ABC12 DEF3 GHY87 it generates only a bookmark for ABC12 when I would like it to generate three bookmarks
For example with a pattern of [A-Z][A-Z][A-Z][0-9]+ on a page containing ABC12 DEF3 GHY87 it generates only a bookmark for ABC12 when I would like it to generate three bookmarks
-
- Site Admin
- Posts: 19917
- Joined: Mon Jan 12, 2009 8:07 am
Re: Generate Bookmarks from Page Text
Hello Nemo,
I've asked a colleague in the dev team to take a look!
When I specify a whole word (e.g. "test") instead of a regular expression - all instances of this word are found and a bookmark created for each. So this might be specific to RegEx. I will know more once my colleague has looked at it, and we will post additional info here.
Kind regards,
Stefan
I've asked a colleague in the dev team to take a look!
When I specify a whole word (e.g. "test") instead of a regular expression - all instances of this word are found and a bookmark created for each. So this might be specific to RegEx. I will know more once my colleague has looked at it, and we will post additional info here.
Kind regards,
Stefan
-
- User
- Posts: 2772
- Joined: Wed Jan 18, 2006 12:10 pm
Re: Generate Bookmarks from Page Text
Maybe a problem with the proximity (neighborhood) of the words (see attached PDF)?
The first page is treated correctly, the second page is not.
De-activating the "Edit Text Elements as Blocks"-option in Edit > Text, does not seem to help.
I do not see any other option in the "Generate Bookmarks From Page Text"-dialog-box that might help.
Is it possible to work around the problem by using font name / font size / text color / text case distinction?
The first page is treated correctly, the second page is not.
De-activating the "Edit Text Elements as Blocks"-option in Edit > Text, does not seem to help.
I do not see any other option in the "Generate Bookmarks From Page Text"-dialog-box that might help.
Is it possible to work around the problem by using font name / font size / text color / text case distinction?
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 19917
- Joined: Mon Jan 12, 2009 8:07 am
Re: Generate Bookmarks from Page Text
Hello Willy Van Nuffel, Nemo,
I actually got it to work with this expression
[A-Z]{3}[0-9]+
Which should give identical matches:
[match an uppercase letter]{exactly three times}[match a single digit] match the previous, the single digit, one or more times (the + symbol).
And this worked perfectly fine for me.
Kind regards,
Stefan
I actually got it to work with this expression
[A-Z]{3}[0-9]+
Which should give identical matches:
[match an uppercase letter]{exactly three times}[match a single digit] match the previous, the single digit, one or more times (the + symbol).
And this worked perfectly fine for me.
Kind regards,
Stefan
-
- User
- Posts: 84
- Joined: Mon Apr 20, 2020 12:23 pm
Re: Generate Bookmarks from Page Text
I've tried [A-Z]{3}[0-9]+ but it doesn't work for me, unfortunately.
-
- User
- Posts: 2772
- Joined: Wed Jan 18, 2006 12:10 pm
Re: Generate Bookmarks from Page Text
The expression proposed by Stefan [A-Z]{3}[0-9]+ also works for me in the example PDF here above.
@Nemo
Can you post an example PDF from your side, where you can not generate the bookmarks in the correct way?
Thanks.
Willy.
@Nemo
Can you post an example PDF from your side, where you can not generate the bookmarks in the correct way?
Thanks.
Willy.
-
- User
- Posts: 84
- Joined: Mon Apr 20, 2020 12:23 pm
Re: Generate Bookmarks from Page Text
Willy,
In your example PDF the three items of text are on three different lines. In my example they are on the same line.
Does it work for you if they are on the same line?
In your example PDF the three items of text are on three different lines. In my example they are on the same line.
Does it work for you if they are on the same line?
-
- User
- Posts: 2772
- Joined: Wed Jan 18, 2006 12:10 pm
Re: Generate Bookmarks from Page Text
When the three items are on the same line, it does not work at all (at least for me). No bookmarks are generated.
I am afraid that in the current state of the bookmarks feature, it will not be possible to achieve what you like.
It only seems to work line by line. I suppose you have pages with three columns of text or something alike?
Best regards.
I am afraid that in the current state of the bookmarks feature, it will not be possible to achieve what you like.
It only seems to work line by line. I suppose you have pages with three columns of text or something alike?
Best regards.
-
- Site Admin
- Posts: 19917
- Joined: Mon Jan 12, 2009 8:07 am
Re: Generate Bookmarks from Page Text
Hello Willy, Nemo,
Provided these are white spaces after each of your strings - I managed to get this to work even when they are on the same line:
[A-Z]{3}[0-9]+\s
Kind regards,
Stefan
Provided these are white spaces after each of your strings - I managed to get this to work even when they are on the same line:
[A-Z]{3}[0-9]+\s
Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 84
- Joined: Mon Apr 20, 2020 12:23 pm
Re: Generate Bookmarks from Page Text
Thank you Stefan
That works for me too. I'm not sure why it should be necessary specify the spaces but for my immediate requirements that works.
That works for me too. I'm not sure why it should be necessary specify the spaces but for my immediate requirements that works.
-
- User
- Posts: 2772
- Joined: Wed Jan 18, 2006 12:10 pm
Re: Generate Bookmarks from Page Text
Thanks Stefan, that is good news for Nemo.
Unfortunately, in my example document this is still not fully working.
Only the first two items are bookmarked, not the third one.
But this is not a problem for me. I only used this feature now for test purposes.
Kind regards.
Willy
Unfortunately, in my example document this is still not fully working.
Only the first two items are bookmarked, not the third one.
But this is not a problem for me. I only used this feature now for test purposes.
Kind regards.
Willy
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 19917
- Joined: Mon Jan 12, 2009 8:07 am
Re: Generate Bookmarks from Page Text
Hello Willy Van Nuffel,
My latest RegEx is looking for a white-space character after the numbers, so if your example had no space after the last entry - it will not match it.
Kind regards,
Stefan
My latest RegEx is looking for a white-space character after the numbers, so if your example had no space after the last entry - it will not match it.
Kind regards,
Stefan