PdfFileEditor.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)
ParameterTypeDescription
inputFileStringInput Pdf file path.
startPageInt32Start page number.
endPageInt32End page number.
outputFileStringOutput 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)
ParameterTypeDescription
inputFileStringInput file path.
pageNumberInt32[]Index of page out of the input file.
outputFileStringOutput 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)
ParameterTypeDescription
inputStreamStreamInput file Stream.
startPageInt32Start page number.
endPageInt32End page number.
outputStreamStreamOutput 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)
ParameterTypeDescription
inputStreamStreamInput file Stream.
pageNumberInt32[]Index of page out of the input file.
outputStreamStreamOutput 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)
ParameterTypeDescription
inputStreamStreamStream of source document.
pageNumberInt32[]Array of page numbers which will be extracted.
responseHttpResponseHttpResponse 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)
ParameterTypeDescription
inputFileStringSource file path.
pageNumberInt32[]Array of page numbers which will be extracted.
responseHttpResponseHttpResponse object where result will be stored.

Return Value

true if pages were extracted successfully.

See Also