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, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
dasy2k1
User
Posts: 65
Joined: Mon Feb 15, 2016 10:55 am
Location: Birmingham UK

Split PDF with Zero padding

Post by dasy2k1 »

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: 461
Joined: Tue Sep 05, 2017 4:56 pm

Re: Split PDF with Zero padding  SOLVED

Post by Ovg »

It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
dasy2k1
User
Posts: 65
Joined: Mon Feb 15, 2016 10:55 am
Location: Birmingham UK

Re: Split PDF with Zero padding

Post by dasy2k1 »

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: 17889
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Split PDF with Zero padding

Post by Tracker Supp-Stefan »

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
User avatar
Vladimir G - Tracker Dev
User
Posts: 40
Joined: Thu Nov 30, 2017 1:24 pm

Re: Split PDF with Zero padding

Post by Vladimir G - Tracker Dev »

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.
Vladimir Goshko
Software Developer
Tracker Software Products
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8544
Joined: Wed Jan 03, 2018 6:52 pm

Re: Split PDF with Zero padding

Post by TrackerSupp-Daniel »

Vmgoshko,
Thank you for the tip there! Dasy2k1, does this help with your case?
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