Author Topic: How to split while preserving bookmarks?  (Read 2451 times)

0 Members and 1 Guest are viewing this topic.

conrad.drake

  • Newbie
  • *
  • Posts: 34
How to split while preserving bookmarks?
« on: November 27, 2014, 09:31:51 AM »
Hi
  it appears that I can preserve bookmarks when merging (eg.  PDFShellTools.exe Merge -IncludeBookmarks filename=f.pdf f1.pdf;f2.pdf) but if try to split the results I loose the bookmarks (eg. PDFShellTools.exe split SplitRules=1s28M   "OutputFilename=[F][1FC1]" f.pdf)

Am I missing a "-PreserveBookmarks" flag or is there a scripting way around this?

Thanks for the help!

RTT

  • Administrator
  • *****
  • Posts: 778
Re: How to split while preserving bookmarks?
« Reply #1 on: November 27, 2014, 05:09:02 PM »
The keep bookmarks functionality is indeed only supported by the merger tool. I opted by this because the bookmarks are preserved entirely, even if the target page of any of the bookmarks is not included in the final document. The current code is unable to rearrange the bookmarks tree because the bookmarks action functionality can be complex enough to determine if a specific bookmark item should be kept or not. The merger tool is usually used to merge complete documents, so this is not a problem, but the same doesn't happen when splitting.

If having all the bookmarks in the splitted documents is not a problem, you can also use the merge function to split. But you will not be able to use some of the specific split rules, such as split by file size.

conrad.drake

  • Newbie
  • *
  • Posts: 34
Re: How to split while preserving bookmarks?
« Reply #2 on: November 28, 2014, 01:28:47 AM »
If having all the bookmarks in the splitted documents is not a problem, you can also use the merge function to split. But you will not be able to use some of the specific split rules, such as split by file size.
Thanks.

So one needs to use the  "pages to include" field - how does one set that from the command line interface?

PDFShellTools.exe Merge  -IncludeBookmarks filename=split_part_2.PDF original_file.PDF

RTT

  • Administrator
  • *****
  • Posts: 778
Re: How to split while preserving bookmarks?
« Reply #3 on: November 28, 2014, 10:58:09 PM »
Right now can't be done from the command line interface, but t've just finished to implement a Merge PagesToInclude parameter that will be available in the next release.

But you can already use the scripting functionality to do it. Take a look to the IDocumentMerger object, and this forum thread for some examples of related scripts.

conrad.drake

  • Newbie
  • *
  • Posts: 34
Re: How to split while preserving bookmarks?
« Reply #4 on: December 01, 2014, 01:38:54 AM »
Right now can't be done from the command line interface, but t've just finished to implement a Merge PagesToInclude parameter that will be available in the next release.

But you can already use the scripting functionality to do it.....

Double thanks!