Issue converting VSD with embedded EMF picture to SVG

Hi!

I am facing a problem converting VSD file to SVG via Processing API. VSD file has embedded image in EMF format. As result of the conversion I get an empty SVG file.
I have attached file with examples.
Is it known issue? Can you provide solution, please?

Thanks,
Serge
Examples.zip (94,9 КБ)

@krserg

Hello Serge,

The issue you’re experiencing with converting a VSD file containing an embedded EMF image to SVG may be related to the handling of embedded images during the conversion process. There are known limitations with certain image formats in the conversion pipeline.

To address this, you can try the following workaround:

  1. Extract the EMF image from the VSD file before conversion.
  2. Convert the EMF image to a supported format (such as PNG or JPEG).
  3. Reinsert the converted image back into the VSD file or use it in the SVG output.

Here’s a basic outline of how you might implement this in code:

// Load the VSD file
Diagram diagram = new Diagram("input.vsd");

// Extract EMF images (if applicable)
// Convert EMF to PNG/JPEG using a suitable method

// Save the diagram as SVG
diagram.Save("output.svg", SaveFileFormat.SVG);

If the problem persists, please consult the latest documentation for updates on this issue, as it may be a known limitation that is being addressed in future releases.

Let me know if you need further assistance!

@krserg
Thanks for the template file and emf.
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-53816

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.

Ok, thanks! We look forward to the fix!

@krserg
When we try to save the VSD as VSDX, or insert this EMF into a new VSDX and save it,It is strange that the image cannot be displayed in the VSDX, or when opening this VSD file with Visio 2019, the image also fails to appear, whereas it displays correctly in Visio 2010.

We need to evaluate this issue of vsd in details.
Thanks.

@philip.zhou , I try to use workaround for this case. I had an idea to ungroup the EMF-image elements before exporting. Emf image is in Shapes collection of the Page object and there is an Ungroup method: Shape.Ungroup | Aspose.Diagram for .NET API Reference
But after invoking this method the Shape element disappeared from the Shapes collection and initial document began corrupted. Is it possible to fix the Ungroup method and make the workaround work?

Thanks,
Serge

@krserg
Thank you for your suggestion. We will look further into it.
Thanks.

1 Like