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.

Thu Apr 05, 2018 6:02 pm

I have a document I split using
Code: Select all
sourceDoc.Split(destinationFolder + destPattern)
but if I check the .TrimBox value of the pages after splitting, it's set to 0.

I've even tried doing something similar, but using different methods.

Code: Select all
PdfDocument splitDoc = new PdfDocument();
splitDoc.InsertPage(sourceDoc,i);
splitDoc.SaveToFile(destinationFolder + destFileName);


Code: Select all
PdfDocument splitDoc = new PdfDocument();
PdfPageBase page = splitDoc.Pages.Add(sourceDoc.Pages[i].Size, new Spire.Pdf.Graphics.PdfMargins(0));
sourceDoc.Pages[i].CreateTemplate().Draw(page, new System.Drawing.PointF(0, 0));
splitDoc.SaveToFile(destinationFolder + destFileName);


Both will copy the page into the new document fine, but it's missing the TrimBox as well.

Is there any way to retain the TrimBox (and CropBox) from the original?

mfreeze
 
Posts: 9
Joined: Fri Dec 01, 2017 12:45 pm

Fri Apr 06, 2018 6:01 am

Hello,

Thank you for contacting us.
I did notice the issue that the returned value of TrimBox is 0 after splitting/inserting/drawing, and will post it to our Dev team for investigating and fixing. To help us better analysis it, could you please provide your testing Pdf file? You could send it to us via email [email protected]. Thanks in advance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Apr 06, 2018 10:40 am

Hi Nina,

I'll send it right over. And thank you for following up on it so quickly.

mfreeze
 
Posts: 9
Joined: Fri Dec 01, 2017 12:45 pm

Fri Apr 06, 2018 11:06 am

Hello,

Thanks for your sharing.
I have logged the issue with your document into our bug tracking system and will keep you updated if there is any progress. So sorry for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF

cron