Hi.
I have DOCX with 10 pages inside.
I need to remove a page break on page #9.
Please, tell me how to do that!?
Thanks
Hi.
I have DOCX with 10 pages inside.
I need to remove a page break on page #9.
Please, tell me how to do that!?
Thanks
Hi Dekan,
Is it an automatic page break or do you have SpecialCharacter
elements of SpecialCharacterType.PageBreak
type or do you have multiple Section
elements (one for each page)?
Can you send us your DOCX file so that we can investigate it?
Regards,
Mario
Sure. Mario. The DOCX: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free
Page#2 has a PageBreak. I wanna to remove it.
Thanks
Try this:
var document = DocumentModel.Load("example.docx");
var pageBreak = document.GetChildElements(true, ElementType.SpecialCharacter)
.Cast<SpecialCharacter>()
.First(sc => sc.CharacterType == SpecialCharacterType.PageBreak);
pageBreak.Content.Delete();
document.Save("example_saved.docx");
I hope this helps.
thanks. awesome. It works