Split by First Level Bookmark and Export to Image  SOLVED

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

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

Post Reply
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Split by First Level Bookmark and Export to Image

Post by thedman07 »

I'm trying to create a tool where the input is a multipage PDF with first level bookmarks for each page and the output is a TIFF file of each page with the file name being the corresponding first level bookmark.

I've tried combining the actions of the Split/Merge tool with the options to split by first level bookmark selected and the Export to Image tool, but it creates the first TIFF correctly, and then tries to create the second one with the same name as the first.

Can you help? I would rather not have to do this as 2 operations.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8440
Joined: Wed Jan 03, 2018 6:52 pm

Re: Split by First Level Bookmark and Export to Image

Post by TrackerSupp-Daniel »

Hi, thedman07

this should be possible, Could I ask you to please send us a copy of the tool you are using currently? You can export any tool in PDF-Tools by right clicking on the tool itself.
To upload it here, you will likely need to place the tool in a Zip folder first.

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
User avatar
DenisO
Site Admin
Posts: 104
Joined: Fri Jun 09, 2017 5:40 pm

Re: Split by First Level Bookmark and Export to Image

Post by DenisO »

Hi thedman07,
you can customize target image filename by using %[FileName]_%[Page] macros to save your file. %[FileName] is source PDF name (in your case it is Top level bookmark name) and %Page is number of page in this PDF document.
image.png
Kind regards,
Denis Oleksenko
Software Developer
Tracker Software Products (Canada) LTD
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Re: Split by First Level Bookmark and Export to Image

Post by thedman07 »

TrackerSupp-Daniel wrote: Wed May 06, 2020 10:02 pm
Split By Bookmark and Convert to Tiff.zip
(1.94 KiB) Downloaded 75 times
Hi, thedman07

this should be possible, Could I ask you to please send us a copy of the tool you are using currently? You can export any tool in PDF-Tools by right clicking on the tool itself.
To upload it here, you will likely need to place the tool in a Zip folder first.

Kind regards,
Please see attached. I don't have any need for the split pdf's so I was trying to avoid ending up with those. If I have to I can delete them after.
User avatar
DenisO
Site Admin
Posts: 104
Joined: Fri Jun 09, 2017 5:40 pm

Re: Split by First Level Bookmark and Export to Image

Post by DenisO »

Hi, thedman07
I've changed you tool's Save images action (see the attachment). Now it uses correct macros %[FileName]_%[Page]. Result file names should be Bookmark_1.tiff,
BookMark_2.tiff... AnotherBookmark_1.tiff,AnotherBookmark_2.tiff, AnotherBookmark_3.tiff...
SplitByBookMarkUsingSave_FileName_PageMacros.zip
(1.94 KiB) Downloaded 72 times
Kind Regards,
Denis Oleksenko
Software Developer
Tracker Software Products (Canada) LTD
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Re: Split by First Level Bookmark and Export to Image

Post by thedman07 »

I get the following error in the log:
[5/7/2020, 12:21:08 PM] Error: Arch.pdf: Invalid value or value type.

Also, I get the following result
image.png
The first file is named as the first level bookmark (which is what I want), and then the file is split with the <Filename><Number> naming scheme.

The first level bookmarks looks like this:
image1.png
The result I'm looking for is a TIFF of each sheet named based on the first level bookmarks
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Split by First Level Bookmark and Export to Image

Post by Vasyl-Tracker Dev Team »

Hi thedman07.

We are unable to reproduce your problem with the fixed tool provided by Denis.
Be sure that you use our latest official build(338). If not - please update PDFTools and try again. If there will still a problem, please provide your file for reproduce it on our side. You can provide it here or you may send it to support@pdf-xchange.com. Thanks.

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Re: Split by First Level Bookmark and Export to Image

Post by thedman07 »

After updating to the latest build, I'm getting the following
image.png
I'll post the file to dropbox and share it with support email. It's a big file and I don't want to post it publicly.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Split by First Level Bookmark and Export to Image

Post by Vasyl-Tracker Dev Team »

Sure, thanks.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Split by First Level Bookmark and Export to Image

Post by Vasyl-Tracker Dev Team »

Just downloaded that file, thanks. Started investigation...
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Split by First Level Bookmark and Export to Image

Post by Vasyl-Tracker Dev Team »

Please try the new 339 build (we just uploaded it). The issue should be fixed.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Re: Split by First Level Bookmark and Export to Image

Post by thedman07 »

It works 99% now, which is good enough for what I'm doing generally.

For some reason, the second sheet repeats the name of the first sheet plus "_001" to make it unique, and then it starts naming them correctly. It includes the "_001" on everything after the first sheet which it shouldn't need, in general.
image.png
image.png (6.16 KiB) Viewed 2717 times
I really appreciate the quick response.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Split by First Level Bookmark and Export to Image  SOLVED

Post by Vasyl-Tracker Dev Team »

Hi thedman07.

The reason of problem is that in your document both bookmarks "A0-0 Cover Sheet" and "A0-1 - SHEET INDEX" pointing to the same page. Then the SplitDocByRootBookmarks-action generates two docs on the output:

A0-0 Cover Sheet.pdf (contains #1 and #2 pages from an original doc)
A0-1 - SHEET INDEX.pdf (contains #3 page from an original doc)

Then the following ExportPdfToImages-action generates 3 different images:

A0-0 Cover Sheet (image of #1 page from and original doc)
A0-0 Cover Sheet (image of #2 page from and original doc)
A0-1 - SHEET INDEX (image of #3 page from and original doc)

And on the last stage of work the SaveImages-action trying to generate 3 files on disk:

A0-0 Cover Sheet.png
A0-0 Cover Sheet.png
A0-1 - SHEET INDEX.png

Its obvious that is impossible to create two files with the same name in the same location. So the SaveImages must solve this conflict as well:
1. by replacing older file by new one
(as result: A0-0 Cover Sheet.png will contain image of #2 page)
2. by asking user "what to do?"
3. by auto-adding the numerical suffix to make new filename unique (your case)
- all depends on the current SaveImages-options.

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
thedman07
User
Posts: 16
Joined: Wed May 06, 2020 9:23 pm

Re: Split by First Level Bookmark and Export to Image

Post by thedman07 »

That makes sense.

There seems like a minor issue that once the _001 is added to resolve the duplicate filename issue, it adds the suffix to all of the subsequent files, even if there is no conflict.

Aside from that, this can be marked solved.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8440
Joined: Wed Jan 03, 2018 6:52 pm

Split by First Level Bookmark and Export to Image

Post by TrackerSupp-Daniel »

:)
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
Post Reply