Logo
My Account |  Site Map | Contact Us  
 The same content in Microsoft HTML help file format is included in the download package.
Extract Pages from Existing PDF File

You can easily extract one or more pages from an existing PDF file. To following code demonstrates how to extract page 2 - 4 (zero based) from an existing PDF file:

//Load the source PDF file
PdfDocument doc = new PdfDocument(pdfFileName);

//Extract page 2, 3, 4 (first page 2, 3 pages, page index is zero based)
PdfDocument doc2 = doc.Clone(2,  3);

//doc2 is a new PdfDocument object containing page 2 - 4
//from the original document
....

If you need to extract multiple segments of the source document at the same time, you can call PdfDocument.Split to split a single file into multiple PDF files. See splitting PDF file for more details.


Direct link to this topic