Insert header and footers-page break for each page

Hi
I want insert editable Rtf document in the .docx file in the place of text in the fallowing way.
if editable Rtf having 4 pages then i need to insert the Editable Rtf document in the Docx document.in 4 pages. i.e each page of editable rtf document should start in the new page of Docx document.
In docx file i need to get headers and footers which are there in editable rtf file.
I am using the latest aspose.words.jdk16.jar file

can any one please help me on this.

can any one please respond me…

Hi Sreelakshmi,


Thanks for your inquiry and sorry for the delayed response.

Sure, you can determine the number of pages in Word document by using Document.PageCount Property. Secondly, for inserting one document into another Word document, I would suggest you please read the following article:
http://www.aspose.com/docs/display/wordsjava/How+to++Insert+a+Document+into+another+Document

Moreover, for importing headers/footers from RTF document into DOCX file, please try using the following code snippet:
public static Document addHeaderFooter(Document document, Section section,  int headerFooterType) throws Exception
{
// Check document input parameter
if (document == null) {
throw new IllegalArgumentException(
“Document object can’t be null !”);
}
if (section == null) {
throw new IllegalArgumentException(
“the section object can’t be null !”);
}
// Add content to the document
for (int i = 0; i < section.getHeadersFooters().getCount(); i++)
{
//Import HeaderFooter of specified type only
if(section.getHeadersFooters().get(i).getHeaderFooterType() == headerFooterType)
{
//Remove HeaderFooter of specified tipe from the destination document
for (int j = 0; j < document.getFirstSection().getHeadersFooters().getCount(); j++)
{
if(document.getFirstSection().getHeadersFooters().get(j).getHeaderFooterType() == headerFooterType)
{
document.getFirstSection().getHeadersFooters().get(j).remove();
}
}
//Import HeaderFooter
Node node = document.importNode(section.getHeadersFooters().get(i),
true, ImportFormatMode.KEEP_SOURCE_FORMATTING);
//Insert header footer into the first section of document
document.getFirstSection().getHeadersFooters().add(node);
}
}
return document;
}
I hope, this will help.

Best Regards,