Free Support Forum - aspose.com

Visio to Html - image size

Hello,

I’m saving vsd file to html. And I see quite big difference between html generated by Aspose component and Visio application. See attachment. You will find there a html from both apps. The problem for me is image representing visio content. To simplify I copied these images to root folder:

  • by aspose.png
  • by visio.png

As you can see visio basically crop the image to real content only (we see the shape only) but aspose generates big image with entire canvas (page) from visio (including marings etc).
In my application I have to mimic visio behavior as much as possible.
Is there a way to generate html with the image cropped to content only (like in real visio app)?

VisioDiff.zip (67.5 KB)

Thanks

@mmdevelopment

Would you kindly share the code snippet that you have used to convert .vsd to .html. We will test the scenario in our environment and address it accordingly.

I have prepared a test application. To use it first you need to set a destination folder where application will generate files and then press buttons below to create files using Aspose and Visio (you need to have visio installed on this machine).

VisioTest.zip (296.8 KB)

You can also find generated files in the solution folder (Result subfolder). The most important item is a image files which represents a visio content (png_1.png in visio and img_0.png in aspose).
It is very important for my company that these files should have the same size (and also html area map should work correct with the smaller image).

If you need more info, please let me know.

Thanks

@mmdevelopment

We have logged an issue as DIAGRAMNET-51737 in our issue tracking system for the sake of detailed investigation. We will surely check it in details and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

@mmdevelopment

Please try method “ShapeToHtml” OR firstly, group the shapes then, use this Sample code:

Aspose.Diagram.Saving.HTMLSaveOptions hs = new Aspose.Diagram.Saving.HTMLSaveOptions();
diagram.Pages[0].Shapes.GetShape(1).ToHTML("out.htm", hs); 

Thanks for the quick response. This solution is partially good (image looks good). But still there is a problem with html representation. There is no < MAP >< AREA > tags in the html file. Using visio and even saving as html in Aspose component such map for shapes (links) is generated.
Here is an example of such map generated by aspose:
img_0.zip (659 Bytes)
If your solution would generate such map, then this solution would be good for me.

@mmdevelopment

We have recorded your concerns and will let you know once any further update will be available.

@mmdevelopment

The issue has been resolved in Aspose.Diagram for .NET 19.12.1 hotfix. We will generate such map as < MAP >< AREA > tags for links in the html file using “shape to html” in next fix and version.

Hello,

I’ve tested the latest (v20.1.0.0) of Aspose.Diagram and the problem with HTML < map >< area> is still exist. Here is the sample app:
VisioTest.zip (45.8 KB)

This sample app uses 2 method of saving html from visio file:
Method 1 - use Diagram.Save() - this works good and < map>< area> is generated
Method 2 - use Shapes.Group().ToHtml() - this method doesn’t generate < map>< area> tags.

To see this compare file img_0.htm from Method1_files and Method2_files after you use this sample app.
I hope you will be able to add this map area to the second method.

Thanks

@mmdevelopment

We have re-opened the ticket and will surely let you know as soon as it is investigated and resolved. Please spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMNET-51737) have been fixed in Aspose.Diagram for .NET 20.1.