Label misplaced in document when extract the file


Hi Team.,

When i have extract the image from document, the label content was misplaced. Please give solution.
I have attached tested output document.label (140.4 KB)

Thank you.,



Thanks for your inquiry. You have shared your output document, we will appreciate it if you please share following resources as well. You may ZIP the documents and attach to the post. We will look into these and will guide you accordingly.

  • Your input Word document
  • Your expected output document, please create it using MS Word
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end.


Hi @tilal.ahmad,

Thanks for your timely replying.
My input document is (2.5 MB)
The resultant output of extracted images having error in label layout I am getting mismatched output images compared with input document.
The resultant output folder (138.4 KB).
How to get exact output images matched with input document.please, kindly provide solution for this.
Thanks & regards,



Thanks for sharing your source documents. Please share your sample code here as well. It will help us to replicate and address your issue exactly.


Thanks for your timely replying.

source code : (58.8 KB)

S S Vadivel



Thanks for your inquiry. We are looking into the issue and will update you soon.


Hi @tilal.ahmad,

Thanks for your reply.

I am awaiting for your reply.




Thanks for your feedback. Sure, I am working on our scenario and will update you as soon as possible.



Thanks for being patient. Please replace generateDocument method in with the following code:

public static Document generateDocument(Document srcDoc, ArrayList nodes) throws Exception
    Document dstDoc = srcDoc.deepClone();
    // Remove the first paragraph from the empty document.
    // Import each node from the list into the new document. Keep the
    // original formatting of the node.
    NodeImporter importer = new NodeImporter(srcDoc, dstDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
    for (Node node : (Iterable<Node>) nodes) {
        Node importNode = importer.importNode(node, true);
        // Return the generated document.
    return dstDoc;

Hope, this helps.

Best regards,


Thanks your effort hafeez. I will try and update you soon.

S S Vadivel