We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to convert visio drawing 11 to visio drawing 15

Hello,

We have Visio drawing 11 images in word document (*.doc). We need to convert them into latest version of Visio drawing 15 (VSDX) programmatically.

/Current configutation/
Office version: Office 2016
Aspose word : 17.2.0.0
Aspose diagram: 17.4.0.0

Could you please tell us is it possible?
If possible how to do this?

Thanks
John

@johnty,

Kindly send us a sample of the Word document. We will investigate and share our findings with you. Your response is awaited.

Hi imran,
I have attached the document. Please have a look.
Test.zip (100.2 KB)
Thanks,

John

@johnty,

We are working over your query and will get back to you soon.

@johnty,

You can import DOC file into Aspose.Words API, retrieve WMF image of Visio drawing 11 and convert WMF to Raster image (with Aspose.Imaging API). With Aspose.Diagram API, you can create a Visio drawing from scratch, insert image as a Visio shape, trim page size and then save Visio drawing in VSDX format. Please refer to these help topics: Extract Images from the Word Document, Converting WMF to Other Image Formats, Import Image as a Visio Shape and Converting a Particular Visio Shape

@imran.rafique,

Thanks for your support.
We have Visio drawing 11 images in word document (*.doc). We need to convert them into latest version of Visio drawing 15 (VSDX) pro-grammatically. We need to update the same document.

Thanks,
John.

@johnty,

Aspose.Diagram API cannot read DOC file and retrieve Visio drawing 11. However, Aspose.Diagram API can read Visio drawing 2003 (version 11), and then export to the latest VSDX format. Aspose.Words API can read DOC files. We have created a thread in Aspose.Words forum and one of the fellow workers will assist you there. Forum thread: https://forum.aspose.com/t/import-a-doc-file-and-retrieve-the-visio-drawing/172825

@johnty,

Please try the following code:

C#

string dataDir = @"C:\Diagram\test2373\";
Aspose.Words.Document doc = new Aspose.Words.Document(dataDir + @"Test.doc");
Aspose.Words.Drawing.Shape shape = (Aspose.Words.Drawing.Shape)doc.GetChild(Aspose.Words.NodeType.Shape, 0, true);
if (shape.OleFormat != null && shape.OleFormat.ProgId == "Visio.Drawing.11")
{
    MemoryStream stream = new MemoryStream();
    shape.OleFormat.Save(stream);
    Diagram diagram = new Diagram(stream);
    diagram.Save(dataDir + "Output.vsdx", SaveFileFormat.VSDX);
}

This is the output VSDX: Output.zip (69.0 KB)