Splitter.ExtractPages
ExtractPages(string, string, int, int)
Removes empty pages from the document and saves the output.
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. |
Remarks
Note that Microsoft Word documents are flow-based by nature and do not have a fixed “page” concept. Consumer applications reflow the content into pages dynamically.
This method builds the document layout to extract pages content. The result of execution depends on the fonts available in the environment, as they are required to correctly build the document layout.
Examples
Shows how to extract the first page from the document.
Splitter.ExtractPages(MyDir + "Simple.docx", ArtifactsDir + "Splitter.ExtractPages.docx", 0, 1);
See Also
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize
ExtractPages(string, string, SaveFormat, int, int)
Removes empty pages from the document and saves the output in the specified 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. |
Remarks
Note that Microsoft Word documents are flow-based by nature and do not have a fixed “page” concept. Consumer applications reflow the content into pages dynamically.
This method builds the document layout to extract pages content. The result of execution depends on the fonts available in the environment, as they are required to correctly build the document layout.
Examples
Shows how to extract the first page from the document and save the result in explicitly specified MS Word Xml 2007 format.
Splitter.ExtractPages(MyDir + "Simple.docx", ArtifactsDir + "Splitter.ExtractPages.xml", SaveFormat.FlatOpc, 0, 1);
See Also
- enum SaveFormat
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize
ExtractPages(Stream, Stream, SaveFormat, int, int)
Removes empty pages from the document and saves the output in the specified 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. |
Remarks
Note that Microsoft Word documents are flow-based by nature and do not have a fixed “page” concept. Consumer applications reflow the content into pages dynamically.
This method builds the document layout to extract pages content. The result of execution depends on the fonts available in the environment, as they are required to correctly build the document layout.
Examples
Shows how to extract the first page from the document using streams.
using (Stream input = File.OpenRead(MyDir + "Simple.docx"))
using (Stream output = File.Create(ArtifactsDir + "Splitter.ExtractPages.rtf"))
{
Splitter.ExtractPages(input, output, SaveFormat.Rtf, 0, 1);
}
See Also
- enum SaveFormat
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize