简体   繁体   中英

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. Is there a simple way to do that?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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