iOS
ComPDFKit PDF SDK
Guides

Page Edit

 

Page manipulation is the ability to perform changes to pages.

 

- To delete pages from a PDF document, use function CPDFDocument::removePageAtIndexSet:.

 

- To insert a blank page into a PDF document, use function CPDFDocument::insertPage:atIndex:.

 

- To insert an image as an entire page into a PDF document, use function CPDFDocument::insertPage:withImage:atIndex:.

 

- To insert specific page from one document to another, use function CPDFDocument::importPages:fromDocument:atIndex:.

 

- To move a page to a new location, use function CPDFDocument::movePageAtIndex:withPageAtIndex:.

 

- To exchange the location of two document pages, use function CPDFDocument::exchangePageAtIndex:withPageAtIndex:.

 

- To replace original document pages with new pages from a different document, use function CPDFDocument::removePageAtIndexSet: and CPDFDocument::importPages:fromDocument:atIndex:.

 

- To rotate a page in a PDF document, refer to the following method in the CPDFPage class.

 

// Rotation on a page. Must be 0, 90, 180 or 270 (negative rotations will be "normalized" to one of 0, 90, 180 or 270).
// Some PDF's have an inherent rotation and so -[rotation] may be non-zero when a PDF is first opened.
@property (nonatomic,assign) NSInteger rotation;

 

 -  To rotate a page in a PDF document, refer to the following method in the CPDFPage class.

 

/**
 * Sets the bounds for the specified box.
 *
 * @discussion If the box does not exist, this method creates it for you.
 * @see CPDFDisplayBox
 */
- (void)setBounds:(CGRect)bounds forBox:(CPDFDisplayBox)box;