Visio to HTML Conversion Cuts Off Diagram Parts

When converting a Visio document to HTML, the resulting diagram appears to be incomplete, with some parts missing. The affected areas are marked in red in the attached screenshot.

Steps to Reproduce:

  1. Start the sample application.
  2. Choose a target folder.
  3. Press “Start.”
  4. Navigate to the chosen folder to view the result.

Attachments:
aspose-test-app.zip (298.6 KB)
image.png (79.8 KB)

Please investigate and provide a fix or workaround.
Thanks

@mmdevelopment

When converting a Visio document to HTML and encountering issues with parts of the diagram being cut off, there are several options you can adjust to improve the output.

  1. Set Page Size: Ensure that the page size is appropriately set for your diagram. You can specify the page size using the PageSize class. For example, you might want to set it to A1 or another suitable format depending on your diagram’s dimensions.

  2. Render Foreground Pages Only: If your diagram contains background pages that are not necessary for the HTML output, you can choose to save only the foreground pages. This can help in focusing on the main content and avoiding any unnecessary cut-offs.

  3. Adjust Page Count and Index: You can control how many pages to render and which page to start from. This is done using the PageCount and PageIndex properties. Make sure these values are set correctly to include all relevant parts of your diagram.

  4. Default Font: If your diagram uses fonts that are not installed on your system, it may cause rendering issues. Setting a default font that is available can help ensure that all text is displayed correctly.

Here is a sample code snippet that demonstrates how to set these options when saving a Visio diagram to HTML:

using Aspose.Diagram;
using Aspose.Diagram.Saving;

public class ConvertVisioToHTML
{
    public static void Run()
    {
        // Load the diagram
        Diagram diagram = new Diagram("path/to/your/diagram.vsdx");

        // Set HTML save options
        HTMLSaveOptions options = new HTMLSaveOptions
        {
            DefaultFont = "MS Gothic", // Set a default font
            PageCount = 2,              // Number of pages to render
            PageIndex = 0,              // Start from the first page
            PageSize = new PageSize(PaperSizeFormat.A1), // Set page size
            SaveForegroundPagesOnly = true, // Save only foreground pages
            SaveToolBar = false,        // Do not include toolbar
            Title = "Your Diagram Title", // Set title
            SaveTitle = true             // Save title in HTML
        };

        // Save the diagram to HTML
        diagram.Save("output.html", options);
    }
}

Make sure to adjust the file paths and options according to your specific needs. If the issue persists after trying these adjustments, consider checking the diagram for any elements that may be positioned outside the visible area or adjusting the layout of the diagram itself.

If you continue to experience problems, please provide additional details or screenshots to help diagnose the issue further.

@mmdevelopment
Thanks for the project and screenshots.
After an initial testing, I am able to reproduce the issue as you mentioned .

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-53684

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-53684) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou