EndNote position is changed after joining documents using Java | DOCX to PDF conversion

Using Aspose Word 16.2.0-jdk1.6.jar and Aspose PDF 11.2.0.jar

Below code snippet to merge four documents EOS.docx,A.docx,B.docx and C.docx and save the merged word document as PDF.

  1. The document A.docx,B.docx and C.docx contains EndNote references.
  2. The EndNote references are getting jumbled/messed-up.
public class TestMe {
    public static void main(String ars[]) throws Exception {
    	Document eos = new Document("D:\\EOS.docx");
    	Document docA = new Document("D:\\A.docx");
    	Document docB = new Document("D:\\B.docx");
    	Document docC = new Document("D:\\C.docx");
    	eos.appendDocument(docA, ImportFormatMode.KEEP_SOURCE_FORMATTING);
    	eos.appendDocument(docB, ImportFormatMode.KEEP_SOURCE_FORMATTING);
    	eos.appendDocument(docC, ImportFormatMode.KEEP_SOURCE_FORMATTING);
    	eos.save("D:\\\\Jumbled.pdf");
    }
}

Actual output document : Jumbled.pdf
Expected output document : EndNote references should display as it is.

How to avoid references messed up in PDF ?

@SHOME

Please note that Aspose.Words mimics the behavior of MS Word. If you join the documents using MS Word and convert final document to PDF, you will get the same output.

Please use the latest version of Aspose.Words for Java 20.6 to get the correct output. We have attached the output PDF with this post for your kind reference. 20.6.pdf (362.4 KB)

@tahir.manzoor The attached A.docx contains references at the end of the document where as the output you given after merging all four documents 20.6.pdf contains the references in between the document.

You are suggesting to use latest version of aspose words for java. Is the issue we are facing resolved in latest version.

@SHOME

The Footnote class is used to represent both footnotes and endnotes in a Word document.

The A.docx does not contain the foot notes. Please check the attached image for detail.
A.png (24.7 KB)

As shared in my previous post, Aspose.Words mimics the behavior of MS Word. Please join the documents using MS Word to check this behavior.

If you want to modify the document using Aspose.Words, you can do it. Please ZIP and attach your expected output document. We will then provide you more information on it.