Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Apr 17, 2023 10:08 pm

I have a C# web app using Spire.PDF to do some PDF adjustments. One thing I need to build is a way to automatically resize the PDF. The program we are uploading the PDF to will only accept files less than 10MB. So if PDF is 35MB, I need to break it into 4 files
i.e.
Original File 35MB
would get broken into
File1.PDF (9.9MB)
File2.PDF (9.9MB)
File3.PDF (9.9MB)
File4.PDF (5.3MB)

how can I do that?

colinmhart
 
Posts: 15
Joined: Thu Aug 18, 2022 7:19 pm

Tue Apr 18, 2023 11:01 am

Hi,

Thank you for your inquiry.

For your requirement, you can refer to the following steps:

1) Split the PDF into multiple PDF documents with one page each.

2) Merge the smaller documents obtained in step 1. If the size of the merged "pdf document X" resulting from merging the first one-page Pdf and the second one-page Pdf is less than 9.9MB, continue to merge the resulting "pdf document X" with the third one-page Pdf , and so on until the size of the merged document is close to 9.9MB. Then proceed to merge the next set of small documents.

This method is suitable for splitting every small document into sizes of no more than 10MB. Moreover, it is impossible to precisely control the number of final documents and the size of each document.
If the above steps cannot meet your needs, it is recommended that you use other methods, such as third-party tools, to divide documents into several compressed packages and then merge them.

If you have any further questions, please feel free to contact us. We'd be happy to help you.

PS:You can refer to the links below for splitting and merging pdf documents:
Split PDF into Multiple PDF Files:https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/NET-Split-PDF-Simply-Split-PDF-Document-to-Multiple-Files-with-C-VB.NET.html
Merge PDF Documents:https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Merge-PDF-Files-with-New-Method-in-C.html

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Return to Spire.PDF

cron