Free Support Forum - aspose.com

Left aligned images overlap in PDF export but not in DOCX export

When creating a document programmatically and inserting left aligned images, the images don’t overlap in the DOCX export, but are positioned one on top of the other in the PDF export. See the attached word_output and pdf_output screenshots for examples.



Here is the code that generated the documents (I also attached it, along with the image files):





public static void main(String[] args) throws Exception {

Document document = new Document();

DocumentBuilder builder = new DocumentBuilder(document);



Shape shape = builder.insertImage(“square.png”);

shape.setWrapType(WrapType.SQUARE);

shape.setRelativeHorizontalPosition(RelativeHorizontalPosition.COLUMN);

shape.setHorizontalAlignment(HorizontalAlignment.LEFT);

shape.setRelativeVerticalPosition(RelativeVerticalPosition.LINE);

shape.setVerticalAlignment(VerticalAlignment.TOP);

shape.setAllowOverlap(false);



shape = builder.insertImage(“small_square.png”);

shape.setWrapType(WrapType.SQUARE);

shape.setRelativeHorizontalPosition(RelativeHorizontalPosition.MARGIN);

shape.setHorizontalAlignment(HorizontalAlignment.LEFT);

shape.setRelativeVerticalPosition(RelativeVerticalPosition.LINE);

shape.setVerticalAlignment(VerticalAlignment.TOP);

shape.setAllowOverlap(false);



document.updatePageLayout();

document.updateFields();

document.save(“imageOverlap.docx”, SaveFormat.DOCX);

document.save(“imageOverlap.pdf”, SaveFormat.PDF);

}







This is with Aspose.Words 11.8.0 for Java. I looked at the PDF in both Adobe Reader and the Mac Preview.app.



Is this a bug in Aspose.Words? Is there a workaround or will it be fixed?



Thanks



-Shad

Hi Shad,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-7094 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-7094) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.