Hi Team,
if (shape.hasImage() && shape.getParentParagraph().getNextSibling() != null
&& shape.getParentParagraph().getNextSibling().getNodeType() == NodeType.PARAGRAPH) {
if <span class="Apple-tab-span" style="white-space:pre"> </span>(shape.getParentParagraph().getNextSibling().toString(SaveFormat.TEXT).startsWith("Fig")
||shape.getParentParagraph().getNextSibling().toString(SaveFormat.TEXT).startsWith(“Sch”)) {
caption = shape.getParentParagraph().getNextSibling().toString(SaveFormat.TEXT);
name = null;
Hi Tahir,
Document doc = new Document(MyDir + "test+(4).docx");
DocumentBuilder builder = new DocumentBuilder(doc);
int i = 1;
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable) shapes)
{
if(shape.hasChart())
{
Document dstDoc = new Document();
NodeImporter importer = new NodeImporter(doc, dstDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
Node newNode = importer.importNode(shape, true);
dstDoc.getFirstSection().getBody().getFirstParagraph().appendChild(newNode);
dstDoc.save(MyDir + "output"+i+".docx");
i++;
}
}
Hi Team,
“Cambria”,“serif”;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-ansi-language:EN-IN;mso-fareast-language:
EN-IN;mso-bidi-language:AR-SA”>Y-axis text cut in the Master PDF” and text also collapsed with images .
Hi team ,
DocumentBuilder builder = new DocumentBuilder(doc);
int i = 1;
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable) shapes)
{
if(shape.hasChart())
{
Document dstDoc = new Document();
NodeImporter importer = new NodeImporter(doc, dstDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
Node newNode = importer.importNode(shape, true);
dstDoc.getFirstSection().getBody().getFirstParagraph().appendChild(newNode);
dstDoc.save(MyDir + “output”+i+".docx");
i++;
}
}
Hi Tahir,
Hi Tahir,
Thanks for your inquiry. Please use following modified code example to get the desired output. Hope this helps you.
Document doc = new Document(MyDir + "test+(14).docx");
DocumentBuilder builder = new DocumentBuilder(doc);
int i = 1;
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable<Shape>) shapes)
{
if(shape.hasChart() || shape.hasImage())
{
Document dstDoc = new Document();
NodeImporter importer = new NodeImporter(doc, dstDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING);
Node newNode = importer.importNode(shape, true);
dstDoc.getFirstSection().getBody().getFirstParagraph().appendChild(newNode);
dstDoc.save(MyDir + "output"+i+".docx");
i++;
}
}
Hi Tahir ,
I am having hope in your solutions .sorry,I will need the solution in java.
Thanks and kind regards,
Priyanga G
Hi tahir,
Thank you very much for your solution.Sorry for the confusion .please ignore my previous message
Thanks & kind regards,
Priyanga G
Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.