ExtractPages
Contents
[
Hide
]ExtractPages(string, string, int, int)
Extracts a specified range of pages from a document file and saves the extracted pages to a new file. The output file format is determined by the extension of the output file name.
public static void ExtractPages(string inputFileName, string outputFileName, int startPageIndex,
int pageCount)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
startPageIndex | Int32 | The zero-based index of the first page to extract. |
pageCount | Int32 | Number of pages to be extracted. |
Examples
Shows how to extract pages from the document.
// There is a several ways to extract pages from the document:
string doc = MyDir + "Big document.docx";
Splitter.ExtractPages(doc, ArtifactsDir + "LowCode.ExtractPages.1.docx", 0, 2);
Splitter.ExtractPages(doc, ArtifactsDir + "LowCode.ExtractPages.2.docx", SaveFormat.Docx, 0, 2);
See Also
- class Splitter
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExtractPages(string, string, SaveFormat, int, int)
Extracts a specified range of pages from a document file and saves the extracted pages to a new file using the specified save format.
public static void ExtractPages(string inputFileName, string outputFileName, SaveFormat saveFormat,
int startPageIndex, int pageCount)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The save format. |
startPageIndex | Int32 | The zero-based index of the first page to extract. |
pageCount | Int32 | Number of pages to be extracted. |
Examples
Shows how to extract pages from the document.
// There is a several ways to extract pages from the document:
string doc = MyDir + "Big document.docx";
Splitter.ExtractPages(doc, ArtifactsDir + "LowCode.ExtractPages.1.docx", 0, 2);
Splitter.ExtractPages(doc, ArtifactsDir + "LowCode.ExtractPages.2.docx", SaveFormat.Docx, 0, 2);
See Also
- enum SaveFormat
- class Splitter
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
ExtractPages(Stream, Stream, SaveFormat, int, int)
Extracts a specified range of pages from a document stream and saves the extracted pages to an output stream using the specified save format.
public static void ExtractPages(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
int startPageIndex, int pageCount)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
startPageIndex | Int32 | The zero-based index of the first page to extract. |
pageCount | Int32 | Number of pages to be extracted. |
Examples
Shows how to extract pages from the document from the stream.
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ExtractPagesStream.docx", FileMode.Create, FileAccess.ReadWrite))
Splitter.ExtractPages(streamIn, streamOut, SaveFormat.Docx, 0, 2);
}
See Also
- enum SaveFormat
- class Splitter
- namespace Aspose.Words.LowCode
- assembly Aspose.Words