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 Misplaced.zip (140.4 KB)

Thank you.,

@Vadivel_S_S

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 Test.zip (2.5 MB)
The resultant output of extracted images having error in label layout misplaced.so I am getting mismatched output images compared with input document.
The resultant output folder isB11_Fig_3.zip (138.4 KB).
How to get exact output images matched with input document.please, kindly provide solution for this.
Thanks & regards,
vadivel

@Vadivel_S_S

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 : NewAip.zip (58.8 KB)

Regards.,
S S Vadivel

@Vadivel_S_S

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&regards,
vadivel

@Vadivel_S_S

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

@Vadivel_S_S,

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

public static Document generateDocument(Document srcDoc, ArrayList nodes) throws Exception
{
    Document dstDoc = srcDoc.deepClone();
    dstDoc.removeAllChildren();
    dstDoc.ensureMinimum();
    // Remove the first paragraph from the empty document.
    dstDoc.getFirstSection().getBody().removeAllChildren();
    // 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);
    dstDoc.getFirstSection().getBody().appendChild(importNode);
    }
        // Return the generated document.
    return dstDoc;
}

Hope, this helps.

Best regards,

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

Regards.,
S S Vadivel