PdfFileEditor.Extract
内容
[
隐藏
]Extract(string, int, int, string)
从输入文件中提取页面,保存为新的 Pdf 文件。
public bool Extract(string inputFile, int startPage, int endPage, string outputFile)
| 参数 | 类型 | 描述 |
|---|---|---|
| inputFile | String | 输入 Pdf 文件路径。 |
| startPage | Int32 | 起始页码。 |
| endPage | Int32 | 结束页码。 |
| outputFile | String | 输出 Pdf 文件路径。 |
返回值
成功返回 true,失败返回 false。
示例
PdfFileEditor pfe = new PdfFileEditor();
pfe.Extract("input.pdf", 3, 7, "output.pdf");
另请参见
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
Extract(string, int[], string)
提取由数字数组指定的页面,保存为新的 PDF 文件。
public bool Extract(string inputFile, int[] pageNumber, string outputFile)
| 参数 | 类型 | 描述 |
|---|---|---|
| inputFile | String | 输入文件路径。 |
| pageNumber | Int32[] | 输入文件中的页面索引。 |
| outputFile | String | 输出文件路径。 |
返回值
操作成功返回 true。
示例
PdfFileEditor pfe = new PdfFileEditor();
pfe.Extract("input.pdf", new int[] { 3, 5, 7 }, "output.pdf");
另请参见
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
Extract(Stream, int, int, Stream)
从输入文件中提取页面,保存为新的 Pdf 文件。
public bool Extract(Stream inputStream, int startPage, int endPage, Stream outputStream)
| 参数 | 类型 | 描述 |
|---|---|---|
| inputStream | Stream | 输入文件流。 |
| startPage | Int32 | 起始页码。 |
| endPage | Int32 | 结束页码。 |
| outputStream | Stream | 输出 Pdf 文件流。 |
返回值
成功返回 true,失败返回 false。
示例
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);
另请参见
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
Extract(Stream, int[], Stream)
提取由数字数组指定的页面,保存为新的 Pdf 文件。
public bool Extract(Stream inputStream, int[] pageNumber, Stream outputStream)
| 参数 | 类型 | 描述 |
|---|---|---|
| inputStream | Stream | 输入文件流。 |
| pageNumber | Int32[] | 输入文件中的页面索引。 |
| outputStream | Stream | 输出文件流。 |
返回值
成功返回 true,失败返回 false。
示例
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);
另请参见
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF