英文:
How can I get rid of blank pages in aspose.words?
问题
我想在将数据保存到PDF文件之前删除空白页面。有没有简单的方法做到这一点?
英文:
I would like to delete blank pages before I save the data to a pdf file. Is there a simple way to do that?
答案1
得分: 2
Word文档不是固定的页面格式,它们是流式的,更类似于HTML。因此,很难确定页面的起始和结束位置,也很难确定某个特定页面是否为空白。
然而,有一些选项可以在Word文档中设置显式的分页符。例如,显式的分页符:
https://apireference.aspose.com/words/java/com.aspose.words/controlchar#PAGE_BREAK
段落选项中的PageBreakBefore:
https://apireference.aspose.com/words/java/com.aspose.words/ParagraphFormat#PageBreakBefore
节的分隔:
https://docs.aspose.com/words/java/working-with-sections/
如果从文档中删除这些显式的分页符,可能有助于去除空白页面。
英文:
Word documents are not fixed page formats, they are flow, more like 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. For example, explicit page break
https://apireference.aspose.com/words/java/com.aspose.words/controlchar#PAGE_BREAK
PageBreakBefore paragraph option.
https://apireference.aspose.com/words/java/com.aspose.words/ParagraphFormat#PageBreakBefore
section break
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论