Hello, may I ask how Java uses aspose. word to retrieve the second page insertion content of an HTML string
@Mikeykiss MS Word documents are flow by their nature, so there is no “page” concept. Consumer applications reflows document content into pages on the fly. So when you insert HTML into the document, Aspose.Words does not split it into pages, this is done on document rendering phase by the consumer application.
Hello, may I ask how to convert the HTML string content into Word and then insert data on the second page? How to use Java code to locate the second page of the document and insert content before the second page? Please use Java as an example. Thank you
@Mikeykiss As I have mentioned, MS Word documents are flow by their nature, so there is no “page” concept. When content overflow the page it is moved to the next page. You can also insert an explicit page break to start from a new page. For example see the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHtml("<b>This is the first page of the document.</b>");
// insert page break.
builder.insertBreak(BreakType.PAGE_BREAK);
builder.insertHtml("<i>This is the second page of the document.</i>");
doc.save("C:\\Temp\\out.docx");