Hi,
We ran into an issue while merging documents concerning header/footer settings. In our usecase, we have a source document that has different even and odd page headers, and the target document(to which the src is appended) has a default header. Each of these documents has only one section. On merging these documents (with link to previous for the src section set to false), we found a discrepancy for the getOddAndEvenPagesHeaderFooter() property of the PageSetup object. Namely, we found that in the merged document’s last section, this property was set to false and as a consequence, it was showing only the odd page header in the output. (setting this property to true however showed the expected result with odd and even page headers for the second section). Shouldn’t the page setup properties for a section be preserved even after merging?
Hi there,
Hi Tahir,
Please find attached the source and target documents (the source is appended to the target) and the final output generated. In this case, the source has a different first page header, slightly different from the use case I mentioned, but even so, he page setup properties are not preserved. I have been using Aspose Words for Java (the latest release 13.5.0) on
my Windows 7 x64 machine and I have been using Java 7 (java version
"1.7.0_21"
Java™ SE Runtime Environment (build 1.7.0_21-b11) )
Hi there,
Document dstDoc = new
Document(MyDir + “target.docx”);<o:p></o:p>
Document srcDoc = new Document(MyDir + "src.docx");
dstDoc.appendDocument(srcDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
for(Section section : (Iterable<Section>)dstDoc.getSections())
{
section.getPageSetup().setOddAndEvenPagesHeaderFooter(true);
}
dstDoc.save(MyDir + "Out.docx");