- Code: Select all
sourceDoc.Split(destinationFolder + destPattern)
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?