如何在aspose.words中去除空白页面?

huangapple go评论64阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年10月5日 20:25:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/64208572.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定