Split PDF by filesize of the resulting single-PDF

Post Reply
CSchulmeyer
Newbie
Posts: 1
Joined: Mon Oct 20, 2014 10:44 am

Split PDF by filesize of the resulting single-PDF

Post by CSchulmeyer »

Hi,



is there any possibility to split an incoming PDF-File by filesize of the resulting single-PDF-files, such as you can do with an Desktop-Version aof Acrobat Pro?



I checked out several configurators --> SplitPDF, pdfToolbox-Actions, Acrobat itself, but all of them can only split an PDF by number of pages.



Thanks for your help,

Christian
freddyp
Advanced member
Posts: 1028
Joined: Thu Feb 09, 2012 3:53 pm

Split PDF by filesize of the resulting single-PDF

Post by freddyp »

Let me guess what you want to do. You want PDF files that are smaller than eg 5MB, but you do not care how many pages there are in the file. The only way to do this reliably is to split the PDF and reassemble the pages based on the sum of the individual file sizes not exceeding a certain limit.



I can think of a way to do this in Switch without using a script, but it would mean that it would take as many minutes as there are parts to the PDF file because of the minimum time interval of "Assemble job" being 1 minute.



The quickest way is to use a script. The scripts gets a folder with PDF's as input (the result of "Split PDF") and it outputs multiple folders with a varying amount of PDF's and these output folders can then be merged with the "Merge PDF" tool.



Can you tell me what tool you know that can split a PDF file in this way?



Freddy
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Split PDF by filesize of the resulting single-PDF

Post by dkelly »

I've written a script to do this; however, the difficulty is if you look at the size of the individual split pages you will not get the results you expect.



For example, I split a PDF with 800 pages into individual pages, group them into 5MB segments and then merge each segment into a PDF I will not get PDF files sized to 5MB. Each split PDF will have it's own copy of any fonts, images, colorspaces, etc. When merging them together a good PDF library will automatically get rid of duplicate resources. A really good PDF library will merge subset fonts also.



So your 5MB segment may end up only be 1MB or less in size.



Dwight Kelly

Apago, Inc.
Post Reply