We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word to pdf conversion produces borders around images

Hello! We are using aspose.words 15.3 for Java to produce pdf from MS Word.


Conversion performed just like in the example:
Document doc = new Document(getMyDir() + “Document.doc”);
doc.save(getMyDir() + “Document.Doc2PdfSave Out.pdf”);

And sometimes it happens that all shapes(pictures) are placed inside the black frames in produced pdf (there is no any border around shape in the original doc file)

Any help will be very appreciated!


After some tests i have found, that with the same MS Word Document on one “сomputer” (JVM) shapes formed with borders, on other JVM without border


NodeCollection shapes = attachment.getChildNodes(NodeType.SHAPE, true, false);
Iterator<com.aspose.words.Shape> it = shapes.iterator();
while (it.hasNext()) {
com.aspose.words.Shape shape = it.next();
BorderCollection bc = shape.getImageData().getBorders();
for(int i=0;i<bc.getCount();i++){
Border b = bc.get(i);
result+="
" + “Border collection: " +i;
result+=”
" + “Border attr: getLineStyle=” + b.getLineStyle() + " getShadow=" + b.getShadow() +
" getLineWidth=" + b.getLineWidth() + " isVisible=" + b.isVisible();

}
// shape.getImageData().getBorders().clearFormatting();
}

And clearFormatting helps.

But what could be a cause for such a strange behaviour ?

Hi,


Thanks for your inquiry. You’re using an old version of Aspose.Words for Java; we suggest you please upgrade to the latest version 16.1.0 from the following link:
Download latest version of Aspose.Words for Java 16.1.0

Also, please upgrade to the latest Java release (1.8.0_73). In case the problem still remains, please attach your input Word document and output PDF file showing the undesired behavior here for testing. We will investigate the issue on our end and provide you more information.

Best regards,