PdfFileEditor.TryExtract
Contents
[
Hide
]TryExtract(string, int, int, string)
Extracts pages from input file,saves as a new Pdf file.
public bool TryExtract(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.
Remarks
The TryExtract method is like the Extract method, except the TryExtract method does not throw an exception if the operation fails.
Examples
PdfFileEditor pfe = new PdfFileEditor();
bool result = pfe.TryExtract("input.pdf", 3, 7, "output.pdf");
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
TryExtract(string, int[], string)
Extracts pages specified by number array, saves as a new PDF file.
public bool TryExtract(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 completed successfully; otherwise, false.
Remarks
The TryExtract method is like the Extract method, except the TryExtract method does not throw an exception if the operation fails.
Examples
PdfFileEditor pfe = new PdfFileEditor();
bool result = pfe.TryExtract("input.pdf", new int[] { 3, 5, 7 }, "output.pdf");
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
TryExtract(Stream, int[], Stream)
Extracts pages specified by number array, saves as a new Pdf file.
public bool TryExtract(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.
Remarks
The TryExtract method is like the Extract method, except the TryExtract method does not throw an exception if the operation fails.
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);
bool result = pfe.TryExtract(sourceStream, new int[] { 3, 5, 8 }, outStream);
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF