PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Insert a blank page or pages from other PDFs into the target document.
This example shows how to insert a blank page:
// The `InsertPage` method allows specifying an image path, and when the image path is empty, it inserts a blank page.
document?.insertPage(CGSize(width: 595, height: 852), withImage: "", at: 0)// The `InsertPage` method allows specifying an image path, and when the image path is empty, it inserts a blank page.
[document insertPage:CGSizeMake(595, 852) withImage:"" atIndex:0]This example shows how to pages from other PDFs:
let insertDocument = CPDFDocument(url: URL(fileURLWithPath: "OtherPDF.pdf"))
var indexSet = IndexSet()
indexSet.insert(0)
document?.importPages(indexSet, from: insertDocument, at: 0)CPDFDocument *insertDocument = [[CPDFDocument alloc] initWithURL:[NSURL fileURLWithPath:@"OtherPDF.pdf"]];
NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
[indexSet addIndex:0];
[document importPages:indexSet fromDocument:insertDocument atIndex:0];