Direct API To Convert Visio Shape to Other formats

Hello


I am currently using Aspose Diagram 6.0 .
For now we need to copy a shape within Visio diagram to a new Visio Diagram and then take the output in various formats.

Can we have one single API which could convert a shape to PDF/HTML (visioShape.toPDF())format rather than copying shape from one Visio diagram to other.

Similar kind of API is present in Aspose Cell Library chart.toPdf() ,It has resolved many of our issues .

It would be great help if we could have direct api for Visio Shapes alo.

Regards
Shubhi

Hi Shubhi,

Thank you for this feature request. Please note that you don’t need to copy a Visio Shape to another Visio. In short, you can read a Visio and remove all other content, except the required shape and then convert this particular shape in any other supported format. Please refer to this help topic: Convert a Visio Shape to Other File Formats. Another way round is that you can also get icons of the Visio shapes and then convert these icons into PDF and HTML formats using Aspose.Pdf API as narrated in these help topics: How to Convert an Image to PDF and Convert PDF to HTML format.

Furthermore, we have logged the feature requests to provide a single API to convert a Visio shape in PDF/HTML as follows:

DIAGRAMJAVA-50290: Provide the single API to convert a Visio shape to PDF

DIAGRAMJAVA-50291: Provide the single API to convert a Visio shape to HTML

Your post has also been linked to these issue IDs. We’ll keep you informed regarding any available updates. Please let us know in case of any further assistance or questions.

@shubhi15sood,

The linked ticket IDs DIAGRAMJAVA-50290 and DIAGRAMJAVA-50291 have been resolved and will be included in the next version 17.12 of Aspose.Diagram for Java API. We will notify you once the next version is published.

@shubhi15sood,

The linked ticket IDs DIAGRAMJAVA-50290 and DIAGRAMJAVA-50291 have been fixed. Please download and try the latest Hotfix version: Aspose.Diagram for Java 17.11.1, and then let us know how that goes into your environment.

In reference to the ticket ID DIAGRAMJAVA-50290, please try the following code:

[Java]

Diagram diagram = new Diagram("e:\\input.vsd");
FileOutputStream out= new FileOutputStream("e:\\out.pdf");
diagram.getPages().get(0).getShapes().getShape(59).toPdf(out);

In reference to the ticket ID DIAGRAMJAVA-50291, please try the following code:

[Java]

FileOutputStream outHtml= new FileOutputStream("e:\\out.html");
com.aspose.diagram.HTMLSaveOptions hs = new com.aspose.diagram.HTMLSaveOptions();
diagram.getPages().get(0).getShapes().getShape(59).toHTML(outHtml,hs);

@shubhi15sood,

The fixes of linked ticket IDs DIAGRAMJAVA-50290 and DIAGRAMJAVA-50291 have been included in the full version 17.12. Please download and try the latest version 17.12 of Aspose.Diagram for Java API.