Extra white space on PDF and PNG exports

When loading a VSD and saving as both a PDF and PNG, there is extra white space on the output surrounding the content.


PDF: Extra space to left and right of content
PNG: Extra space left, right and below the content

Interestingly if I remove the vertical lines in the VSD this will solve the issue on the PDF but not the PNG. I can not find any reason why the vertical lines would cause an issue and indeed if I replace them with rectangles the diagram will save to PDF without the extra space.

VSD, PNG and PDF files are all attached

Hi Broussard,


Thank you for posting the problematic drawing. We have tested it against the latest build of Aspose.Diagram 2.3.0 and.managed to replicate the extra white space around the drawing. These issues have been logged as follows:

DIAGRAMJAVA-50107 - VSD to PDF export, extra white space on the left and right side of the drawing
DIAGRAMJAVA-50108 - VSD to PNG export, extra white space on the left and right side of the drawing

Your request has also been linked to these issues. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

I have tested this in version 4.0 and the issue still occurs - can you please let me know when this will be resolved. We cannot use Aspose for our requirements until this is resolved.

Hi Broussard,

Thank you for asking about an update. We're sorry to share with you that the linked issues are pending for the analysis and not resolved yet. We have asked the responsible developer to take a look at your issues shortly. We'll let you know once any update is available from him in this regard. We're sorry for the inconvenience you faced.

Hi Broussard,


Thank you for being patient. We have a good news for you that the issue id DIAGRAMJAVA-50107 and DIAGRAMJAVA-50108 have now been resolved. If there is no issue in the QA phase, then these fixes will be included in the next version of Aspose.Diagram for Java 5.0.0. We’ll inform you via this forum thread as soon as the new release is published.

The issues you have found earlier (filed as DIAGRAMJAVA-50107;DIAGRAMJAVA-50108) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

This does not seem to be fixed in v5.0. I have tested this with v5.0 on Windows (java) and the issue is exactly the same, even using the original example files provided.

On further investigation - there are some improvements over the previous version. What I have found is:


  • It seems to render OK in PDF in Linux and Windows
  • On Windows (I’m using 8.1) there is still white space to the right and below the image when rendering to PNG
  • It seems to render to PNG fine on Linux
Thanks,
Ed

Hi Broussard,


Thank you for writing to us. We have tested your sample Visio diagram against the latest build of Aspose.Diagram for Java 5.0.0 in Windows 8.1. We did not notice the extra white space around the actual diagram. We have attached output PNG file for your reference. In case, it is still reproducible, then please share other environment details e.g. operating system edition, JDK version and IDE. We’ll further investigate it.

I’ve attached the output and the code used to generate. As you can see there is a large amount of white space below and to the right of the content.


I am using the following:

Windows 8.1 Pro

java version "1.8.0_31"
Java™ SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot™ 64-Bit Server VM (build 25.31-b07, mixed mode)



Hi Broussard,


Thank you for sharing sample code and resultant image. We’re working over your query and will get back to you soon.

Hi Broussard,


Thank you for being patient. We’re afraid. We could not reproduce the extra white space around the original diagram. We have tested against the said environment. Which IDE are you using? and what is the build version and edition e.g. Netbeans, Eclipse or IntelliJ.

We’re able to get perfect result without extra white space around the diagram. Your build process could be faulty. Please run this source code through command prompt without IDE and let us know how it goes on your side.

We’re looking forward to helping you.

I’m actually using the command prompt rather than any IDE. Can we set up a short video call and I can demo the problem. Please contact me on my registered email address and we can arrange something.


Thanks,
Ed

Hi Broussard,

It appears as the java compiler is including an old version of Aspose.Diagram jar. You can include jar file in the "javac" command using the "-cp" option. Please check details there: http://stackoverflow.com/questions/9395207/how-to-include-jar-files-with-java-file-and-compile-in-command-prompt

However, we can discuss the matter over live chat session. Its option is available on the Aspose site. You can catch me around 2:00PM to 4:00 PM GMT+5:00. In case this timing is not suitable to you then please confirm the timing and day so that I would keep myself present on the live chat.

Hi Broussard,


Thank you for contacting through live support. We are further investigating it and will get back to you soon. Please spare us a little time.

Imran,


I have sent you a private message. I still have this issue, can you please let me know the progress.

Thanks,
Ed

Hi Broussard,


Thank you for being patient. We have exported your sample diagram through the java commands without IDE. It is generating an image file without white space around the actual diagram. You could make a separate folder and put jar files there, then set the CLASSPATH environment variable. Please try the following commands as I did:

C:\mywork>set path=%path%;C:\Program Files\Java\jdk1.8.0_31\bin
C:\mywork>set path=%path%;C:\mywork
javac -cp aspose-diagram-5.0.0.jar ProcessVisio.java
java -cp .;aspose-diagram-5.0.0.jar ProcessVisio

I have attached “mywork” folder for your ease. Please let us know how it goes on your side.

Note: If you’re putting your jar files in JDK’s lib folder, then it’s not good practice.