Splitter.RemoveBlankPages
RemoveBlankPages(string, string)
Removes empty pages from the document and saves the output.
public static List<int> RemoveBlankPages(string inputFileName, string outputFileName)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
Return Value
List of page numbers has been considered as blank and removed.
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 and removes breaks that may produce empty pages during reflow. 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 remove blank pages from the document.
List<int> clearedPages = Splitter.RemoveBlankPages(MyDir + "ManyPages.docx", ArtifactsDir + "Splitter.RemoveBlankPages.docx");
See Also
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize
RemoveBlankPages(string, string, SaveFormat)
Removes empty pages from the document and saves the output in the specified format.
public static List<int> RemoveBlankPages(string inputFileName, string outputFileName,
SaveFormat saveFormat)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The save format. |
Return Value
List of page numbers has been considered as blank and removed.
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 and removes breaks that may produce empty pages during reflow. 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 remove blank pages from the document and save the result in explicitly specified MS Word Xml 2003 format.
List<int> clearedPages = Splitter.RemoveBlankPages(MyDir + "ManyPages.docx", ArtifactsDir + "Splitter.RemoveBlankPages.xml", SaveFormat.WordML);
See Also
- enum SaveFormat
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize
RemoveBlankPages(Stream, Stream, SaveFormat)
Removes empty pages from the document and saves the output in the specified format.
public static List<int> RemoveBlankPages(Stream inputStream, Stream outputStream,
SaveFormat saveFormat)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
Return Value
List of page numbers has been considered as blank and removed.
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 and removes breaks that may produce empty pages during reflow. 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 remove blank pages from the document using streams.
using (Stream input = File.OpenRead(MyDir + "ManyPages.docx"))
using (Stream output = File.Create(ArtifactsDir + "Splitter.RemoveBlankPages.odt"))
{
List<int> clearedPages = Splitter.RemoveBlankPages(input, output, SaveFormat.Odt);
}
See Also
- enum SaveFormat
- class Splitter
- namespace Wordize.Splitting
- assembly Wordize