Free Support Forum - aspose.com

VSDX2EMF - Differences after conversion

Using aspose-diagram-20.5.0-jdk16.jar to convert a VSDX to EMF.

After converting the VSDX to EMF, there were many differences between the two files. Such as cropped images being chopped, images with white backgrounds changed to be a black background, font changing colour and distorted text.

Code Below:
Diagram vdxDiagram = new Diagram(inputPath);
vdxDiagram.save(outputPath, com.aspose.note.SaveFormat.Pdf);

Before/after sample attached.
VisioBug.zip (369.0 KB)

@simon.wiseman

The code you have shared is saving the diagram in PDF format. Also, it is using Aspose.Note classes. Would you kindly share code snippet to convert VSDX to EMF so that we can further proceed accordingly.

Sorry I should have said that the first problem is that it produces an EMF instead of a PDF. I am trying to save the VSDX as a PDF, but what comes out is an EMF file and that EMF isn’t quite right. So therefore there are two problems here:

  1. It creates the wrong format (EMF instead of PDF).
  2. The output file doesn’t look right.

I have changed my code for VSDX2PDF from this:
Diagram vdxDiagram = new Diagram(inputPath);
vdxDiagram.save(outputPath, com.aspose.note.SaveFormat.Pdf);
To this:
Diagram vdxDiagram = new Diagram(inputPath);
vdxDiagram.save(outputPath, new com.aspose.diagram.PdfSaveOptions());
And now with the second piece of code I can successfully transform a VSDX file to a PDF file.

1 Like

@simon.wiseman

The second code snippet is the right way to convert VSDX to PDF. Nevertheless, it is good to know that your issue has been resolved. Please keep using our API and in case of any issue, please feel free to contact us.

Great, thank you.