简体   繁体   English

如何摆脱 aspose.words 中的空白页?

[英]How can I get rid of blank pages in aspose.words?

I would like to delete blank pages before I save the data to a pdf file.我想在将数据保存为 pdf 文件之前删除空白页。 Is there a simple way to do that?有没有一种简单的方法可以做到这一点?

Word documents are not fixed page formats, they are flow, more like HTML. Word 文档不是固定的页面格式,它们是流动的,更像 HTML。 So, there is no easy way to determine where page starts or ends and no easy way to determine whether some particular page is blank.因此,没有简单的方法可以确定页面的开始或结束位置,也没有简单的方法可以确定某个特定页面是否为空白。 However, there are few options to set n explicit page break in Word document.但是,在 Word 文档中设置 n 个显式分页符的选项很少。 For example, explicit page break https://apireference.aspose.com/words/java/com.aspose.words/controlchar#PAGE_BREAK例如,显式分页符https://apireference.aspose.com/words/java/com.aspose.words/controlchar#PAGE_BREAK

PageBreakBefore paragraph option. PageBreakBefore 段落选项。 https://apireference.aspose.com/words/java/com.aspose.words/ParagraphFormat#PageBreakBefore https://apireference.aspose.com/words/java/com.aspose.words/ParagraphFormat#PageBreakBefore

section break https://docs.aspose.com/words/java/working-with-sections/分节符https://docs.aspose.com/words/java/working-with-sections/

If you delete such explicit page breaks from your document, this might help you to get rid blank pages.如果您从文档中删除此类明确的分页符,这可能会帮助您摆脱空白页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM