Windows
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.RemovePages(int[] pageIndexs).

- To insert a blank page into a PDF document, use function CPDFDocument.InsertPage(int pageIndex, double width, double height, string imagePath="").

- To insert an image as an entire page into a PDF document, use function CPDFDocument.InsertPage(int pageIndex, double width, double height, string imagePath).

- To insert specific page from one document to another, use function CPDFDocument.ImportPagesAtIndex(CPDFDocument otherDocument, string pageRange,int pageIndex).

- To move a page to a new location, use function CPDFDocument.MovePage(int startIndex, int endIndex).

- To exchange the location of two document pages, use function CPDFDocument.ExchangePage(int firstIndex, int secondIndex).

- To replace original document pages with new pages from a different document, use function CPDFDocument.RemovePages(int[] pageIndexs) and CPDFDocument.ImportPagesAtIndex(CPDFDocument otherDocument, string pageRange,int pageIndex).

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

 

// Rotation on a page. Must be 0, 1, 2 or 3 (negative rotations will be "normalized" to one of 0, 1, 2 or 3).
// Some PDF's have an inherent rotation and so -[rotation] may be non-zero when a PDF is first opened.
CPDFPage.RotatePage(int pageIndex,int rotation).