Hi, everyone,
As far as I know, RadEditor doesn't have a page break functionality when HTML is exporting to DOCX. I've found a solution for this:
DocxFormatProvider provider = new DocxFormatProvider();
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
List<string> result = this.PrepareStringToExport(htmlPage); //result is a list with divided "pages"
RadFlowDocument newDoc = new RadFlowDocument();
RadFlowDocumentEditor newEditor = new RadFlowDocumentEditor(newDoc);
RadFlowDocument document;
foreach(string element in result)
{
document = new RadFlowDocument();
document = htmlProvider.Import(element);
newEditor.InsertDocument(document);
newEditor.InsertBreak(BreakType.PageBreak);
}
byte[] byteArray = provider.Export(newEditor.Document);
string fileName = "filename.docx";
Utils.SendBytesAsFileToClientWithAjax(Response, fileName, byteArray);
If there is a cleaner solution, let me know
Best regards
Marcin