Split PDF with Zero padding  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, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
dasy2k1
User
Posts: 33
Joined: Mon Feb 15, 2016 10:55 am

Split PDF with Zero padding

Post by dasy2k1 » Thu Jan 23, 2020 11:28 am

Hi I need to split some large multi page PDFs into one page files
the Merge/split tool seems to do this fine (split every 1 page) with one issue,
the ouput is

filename-1.pdf
filename2.pdf
.....
filename-9.pdf
filename-10.pdf
.....
filename-99.pdf
filename-100.pdf
and so on

the problem is that I then need to feed the output into another script that cant cope correctly with these names and reads them in the order
1, 10, 100, 101, 102..... 109, 11, 110, 111, 112 .... 119, 12, 120 .... 19, 191 ... 199, 2, 20, 200, and so on. which isnt helpful

what i want to do is name the output files with sufficient zero padding to cover the number of pages.

so i get
filename-001.pdf
filename-002.pdf

but i cant figure out what setting i need to do to get this

User avatar
Ovg
User
Posts: 306
Joined: Tue Sep 05, 2017 4:56 pm
Location: Moscow

Re: Split PDF with Zero padding  SOLVED

Post by Ovg » Thu Jan 23, 2020 12:50 pm

It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 8.0 (Build 339.0) / W7 x64 SP1

dasy2k1
User
Posts: 33
Joined: Mon Feb 15, 2016 10:55 am

Re: Split PDF with Zero padding

Post by dasy2k1 » Thu Jan 23, 2020 1:19 pm

Thanks for that, its working well enough for now

be nice though if there was an automatic way of getting the right number based on the %[pages] value so 1-9 gives :1 10-99 gives :2 100-999 gives :3 1000-9999 gives :4 and so on automatically

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

Re: Split PDF with Zero padding

Post by Tracker Supp-Stefan » Thu Jan 23, 2020 3:13 pm

Hello Dasy,

Glad to hear that OVG's suggestion works for you.
Unfortunately there isn't such an "auto add the necessary number of leading zeroes" macro.

Regards,
Stefan

vmgoshko
User
Posts: 8
Joined: Thu Nov 30, 2017 1:24 pm

Re: Split PDF with Zero padding

Post by vmgoshko » Thu Jan 23, 2020 9:54 pm

Hello Dasy,
dasy2k1 wrote:
Thu Jan 23, 2020 1:19 pm
be nice though if there was an automatic way of getting the right number based on the %[pages] value so 1-9 gives :1 10-99 gives :2 100-999 gives :3 1000-9999 gives :4 and so on automatically
If you will use this macro for filename(without explicit setting number of digits): "%[FileName]-%[AutoNumber]", Save Document tool will automaticaly choose number of digits for %[AutoNumber] based on amount of documents that you are saving.

For example, if you want to split document that have 100 pages by 1 page, you will get 100 output documents and %[AutoNumber] macro result will have 3 digits.

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 3420
Joined: Wed Jan 03, 2018 6:52 pm

Re: Split PDF with Zero padding

Post by TrackerSupp-Daniel » Thu Jan 23, 2020 11:15 pm

Vmgoshko,
Thank you for the tip there! Dasy2k1, does this help with your case?
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Support: <Support@tracker-software.com>
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply