Extract

Extract(string, int, int, string)

Extracts pages from input file,saves as a new Pdf file.

public bool Extract(string inputFile, int startPage, int endPage, string outputFile)
Parameter Type Description
inputFile String Input Pdf file path.
startPage Int32 Start page number.
endPage Int32 End page number.
outputFile String Output Pdf file path.

Return Value

True for success, or false.

Examples

PdfFileEditor pfe = new PdfFileEditor();
pfe.Extract("input.pdf", 3, 7, "output.pdf");

See Also


Extract(string, int[], string)

Extracts pages specified by number array, saves as a new PDF file.

public bool Extract(string inputFile, int[] pageNumber, string outputFile)
Parameter Type Description
inputFile String Input file path.
pageNumber Int32[] Index of page out of the input file.
outputFile String Output file path.

Return Value

True if operation was succeeded.

Examples

PdfFileEditor pfe = new PdfFileEditor();
pfe.Extract("input.pdf", new int[] { 3, 5, 7 }, "output.pdf");

See Also


Extract(Stream, int, int, Stream)

Extracts pages from input file,saves as a new Pdf file.

public bool Extract(Stream inputStream, int startPage, int endPage, Stream outputStream)
Parameter Type Description
inputStream Stream Input file Stream.
startPage Int32 Start page number.
endPage Int32 End page number.
outputStream Stream Output Pdf file Stream.

Return Value

True for success, or false.

Examples

PdfFileEditor pfe = new PdfFileEditor();
Stream sourceStream = new FileStream("file1.pdf", FileMode.Open, FileAccess.Read);
Stream outStream = new FileStream("out.pdf", FileMode.Create, FileAccess.Write);
pfe.Extract(sourceStream, 1, 3, 6, outStream);

See Also


Extract(Stream, int[], Stream)

Extracts pages specified by number array, saves as a new Pdf file.

public bool Extract(Stream inputStream, int[] pageNumber, Stream outputStream)
Parameter Type Description
inputStream Stream Input file Stream.
pageNumber Int32[] Index of page out of the input file.
outputStream Stream Output file stream.

Return Value

True for success, or false.

Examples

PdfFileEditor pfe = new PdfFileEditor();
Stream sourceStream = new FileStream("file1.pdf", FileMode.Open, FileAccess.Read);
Stream outStream = new FileStream("out.pdf", FileMode.Create, FileAccess.Write);
pfe.Extract(sourceStream, new int[] { 3, 5, 8 }, outStream);

See Also


Extract(Stream, int[], HttpResponse)

Extracts specified pages form source file and stores result into HttpResponse object.

public bool Extract(Stream inputStream, int[] pageNumber, HttpResponse response)
Parameter Type Description
inputStream Stream Stream of source document.
pageNumber Int32[] Array of page numbers which will be extracted.
response HttpResponse HttpResponse object where result will be stored.

Return Value

True if operation was succeeded.

See Also


Extract(string, int[], HttpResponse)

Extracts specified pages from source file and stores result into HttpResponse object.

public bool Extract(string inputFile, int[] pageNumber, HttpResponse response)
Parameter Type Description
inputFile String Source file path.
pageNumber Int32[] Array of page numbers which will be extracted.
response HttpResponse HttpResponse object where result will be stored.

Return Value

true if pages were extracted successfully.

See Also