PdfFileEditor.TryDelete
TryDelete(string, int[], string)
Deletes pages specified by number array from input file, saves as a new Pdf file.
public bool TryDelete(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 TryDelete method is like the Delete method, except the TryDelete method does not throw an exception if the operation fails.
Examples
PdfFileEditor pfe = new PdfFileEditor();
bool result = pfe.TryDelete("input.pdf", new int[] { 2, 3 }, "out.pdf");
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
TryDelete(Stream, int[], Stream)
Deletes pages specified by number array from input file, saves as a new Pdf file.
public bool TryDelete(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 TryDelete method is like the Delete method, except the TryDelete method does not throw an exception if the operation fails.
Examples
PdfFileEditor pfe = new PdfFileEditor();
Stream intputStream = new FileStream("input.pdf", FileMode.Open, FileAccess.Read);
Stream outputStream = new FileStream("output.pdf", FileMode.Create, FileAccess.Write);
bool result = pfe.TryDelete(inputStream, new int[] { 2, 3 }, outputStream);
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
TryDelete(string, int[], HttpResponse)
Deletes specified pages from document and stores result into HttpResponse object.
public bool TryDelete(string inputFile, int[] pageNumber, HttpResponse response)
Parameter | Type | Description |
---|---|---|
inputFile | String | Path of source file. |
pageNumber | Int32[] | Array of page numbers which must be deleted. |
response | HttpResponse | Response object where result document will be stored. |
Return Value
true if operation completed successfully; otherwise, false.
Remarks
The TryDelete method is like the Delete method, except the TryDelete method does not throw an exception if the operation fails.
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
TryDelete(Stream, int[], HttpResponse)
Deletes specified pages from document and saves result into HttpResponse object.
public bool TryDelete(Stream inputStream, int[] pageNumber, HttpResponse response)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | Source document stream. |
pageNumber | Int32[] | Array of page numbers which will be deleted. |
response | HttpResponse | HttpResponse object |
Return Value
true if operation completed successfully; otherwise, false.
Remarks
The TryDelete method is like the Delete method, except the TryDelete method does not throw an exception if the operation fails.
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF