When using document builder to insert a page break using the following code
builder.insertBreak(BreakType.PAGE_BREAK);
it adds a paragraph break to the inserted/next page. I need a way to either prevent this or remove the added paragraph tag.
When using document builder to insert a page break using the following code
builder.insertBreak(BreakType.PAGE_BREAK);
it adds a paragraph break to the inserted/next page. I need a way to either prevent this or remove the added paragraph tag.
Thanks for your inquiry. Please note that Aspose.Words mimics the behavior of MS Word. If you perform the same scenario using MS Word, you will get the same output.
Could you please ZIP and attach your input and expected output Word documents? We will then provide you more information about your query.
Thanks for your inquiry. It seems that you are inserting the page break inside table. To ensure a timely and accurate response, please attach the following resources here for testing:
As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.
PS: To attach these resources, please zip and upload them.
The page break is NOT being inserted inside the table but happens EVERY time a table is created AFTER a page break is added. Here is the graphic as well as source files to that demonstrate the problem.
Thanks for sharing the detail. The CompatibilityOptions.SplitPgBreakAndParaMark property always move paragraph mark to page after a Page Break. You need to disable this property as shown below to get the desired output.
builder.insertHtml("html text");
builder.getDocument().getCompatibilityOptions().setSplitPgBreakAndParaMark(false);
builder.getDocument().save(MyDir + "output.docx");
I have been searching for this probably for 3 months straight…
Can u please explain how does works cause description from documentary not explains it wisely enough
What about odt. Has same issue in odt documents
@bloodboilAaromatic Page break in MS Word documents is a simple character. It is a child of paragraph, the same as any other text.
<w:p w14:paraId="2C0B310B" w14:textId="26E96D38" w:rsidR="008C0668" w:rsidRDefault="008C0668">
<w:r>
<w:br w:type="page"/>
</w:r>
</w:p>
It can be in a separate paragraph as in the above example, the same as in the middle of paragraph.