VSDX saved to PDF is missing elements

Hi,

When converting a specific .vsdx to .pdf, most of its content is not visible.

I’m using this code:

Diagram diag = new Diagram(options.SourcePath);
diag.Save(options.DestinationPath, SaveFileFormat.Pdf);

@sogidev

It seems that you are experiencing issues with missing elements when converting a .vsdx file to PDF using Aspose.Diagram. This problem has been reported by other users as well, and it appears to be a known issue that has been logged for further investigation.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check for Updates: Ensure that you are using the latest version of the Aspose.Diagram library. Sometimes, issues are resolved in newer releases.

  2. License Application: Make sure that you are applying the license correctly before performing the conversion. There have been instances where users did not notice issues because they were not using a valid license.

  3. Use PDF Save Options: You can customize the PDF saving options to improve the output. For example, you can set options to save only the foreground pages, specify the JPEG quality, and define the default font. Here’s a sample code snippet that demonstrates how to set these options:

    using Aspose.Diagram;
    using Aspose.Diagram.Saving;
    
    // Load the diagram from a VSDX file
    Diagram diagram = new Diagram("path/to/your/file.vsdx");
    
    // Initialize PDF save options
    PdfSaveOptions options = new PdfSaveOptions
    {
        SaveForegroundPagesOnly = true,
        JpegQuality = 100,
        DefaultFont = "Arial",
        Compliance = PdfCompliance.Pdf15
    };
    
    // Save the diagram to PDF
    diagram.Save("path/to/output/file.pdf", options);
    
  4. Contact Support: If the issue persists, consider reaching out to Aspose support with your specific .vsdx file and the code you are using. They may provide additional insights or workarounds.

For further details, you can refer to the discussions on this topic in the Aspose forum, where similar issues have been addressed.

If you have any more questions or need further assistance, feel free to ask!

diagram.zip (307,9 Ko)

Inside the zip you’ll find:

  • the original document
  • the document when saved by aspose.diagram, which is missing most elements
  • the document when exported by visio itself, showing all items

thanks

@sogidev
Thanks for the template file and output files.
After an initial testing, I am able to reproduce the issue as you mentioned by using your template file.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53766

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53766) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

@sogidev
Please try the following code to draw an EMF+ image:

        var PDFso = new Aspose.Diagram.Saving.PdfSaveOptions();
        PDFso.EmfRenderSetting = Aspose.Diagram.EmfRenderSetting.EmfPlusPrefer;
        diagram.Save("output.pdf", PDFso);

Hi,

Using EMF+ rendering on 25.6.0 gives an adequate result. Thank you!

@sogidev
It is great that you were able to resolve this issue on your end. In case you have further inquiries or may need any help in future, please let us know by posting a new thread in Aspose.Diagram’ forum.
Thanks.