Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

How can I split a PDF file by megabytes using VBA?

$
0
0

I wrote a routine to split .PDF files by page count and I notice that even if you use the Save method with PDSaveCollectGarbage parameter, the file size of the original file which I copied & deleted pages out of stays the same.

 

So now my task is to split the file by filesize using VBA. Everything I've thought of seems fraught with pitfalls. If I take the filesize of the original file and divide it by the number of pages it contains, what happens if the PDF is image-heavy in the first part of the file? If I go over the MB limitation by even 1 page, I'd have to start over, since cutting out a page won't decrease the file size.

 

Any ideas on this? I can't split in the middle of a page and I must end up with files that are readable in Acrobat.


Viewing all articles
Browse latest Browse all 10848


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>