Author Topic: Create Bookmarks from Text String  (Read 78 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 52
Create Bookmarks from Text String
« on: August 22, 2019, 03:15:11 AM »
Hi again, looking for a batch script to create bookmarks for pages automatically, and to label those bookmarks based on a text string in the file.
That could be header, footer or other information - assuming it was searchable text.

example: Search document for text="Page *" Bookmark Creation = "Page *"
Page 1 = Page 1
Page 10 = Page 10
Page 136 = Page 136


Then saving to an output folder.

RTT

  • Administrator
  • *****
  • Posts: 829
Re: Create Bookmarks from Text String
« Reply #1 on: August 23, 2019, 01:43:58 AM »
Accessing the pages text, from a script, is already implemented, so searching for that text patterns may be possible. But the current scripts API, related to PDF bookmarks, is read only. I need first to add bookmark add/edit functionality, before we can implement such idea in a script.

nightslayer23

  • Newbie
  • *
  • Posts: 52
Re: Create Bookmarks from Text String
« Reply #2 on: August 23, 2019, 05:22:32 AM »
something you think may be possible..?

RTT

  • Administrator
  • *****
  • Posts: 829
Re: Create Bookmarks from Text String
« Reply #3 on: August 24, 2019, 01:55:33 AM »
The only uncertainly is the difficulty, or not, to find the text strings that defines each bookmark title and page target, as you haven't provided a sample file.
Thinking out of the box, because the merger tool is able to create bookmarks with the name of each merged file, the document can be searched for these text patters, split it at these page intervals (between two search matches) to a new file, named with the text found, and then merge this files into a new PDF.