Here i had attached two sample files which i am facing an issue . In part images each image present in seperate paragraph so i need to convert it into a single paragraph so that it will be easy to extract the images without any difficulties.I am also attached a sample output kindly go through and provide some solution regarding my queries.
We already shared the code example to extract the images from the document. You do not need to merge shapes of paragraph. Please check the code example shared in following post.
@tahir.manzoor
Thanks for your reply.
We are using preclean up process so that i need to merge shapes paragraph please provide some solution for above mentioned requirement with the help of same sample documents.
Please iterate over paragraph nodes and get the paragraphs before Fig caption. You can use following method to merge the paragraphs. Hope this helps you.
public static void mergeParagraphs(Paragraph dstPar, Paragraph srcPar)
{
//move all content from source paragraph into the destination paragraph
while (srcPar.hasChildNodes())
dstPar.appendChild(srcPar.getFirstChild());
//Remove source paragraph
srcPar.remove();
}
@tahir.manzoor
As you said i tried but didn’t archive the correct output can you please give me the solution in detail code.Here i should merge two paragraph which contains two images with seperate paragraph.kindly provide the solution in detail manner is very needful to me.
Please use the following code example to merge the images. We have attached the output document with this post for your kind reference. Hope this helps you. 20.4.zip (4.0 MB)