Здравствуйте!
Подскажите пожалуйста, имеется ли возможность добавить гиперссылку, то есть связать фигуру с URL-адресом?
Здравствуйте!
Подскажите пожалуйста, имеется ли возможность добавить гиперссылку, то есть связать фигуру с URL-адресом?
Онлайн-редактор Visio - Aspose Visio Editor
Спасибо за уточнение.
Тогда это вопрос к команде Aspose.Diagram.
Пожалуйста подождите пока они ответят. ![]()
Мы открыли следующие новые заявки в нашей внутренней системе отслеживания проблем и доставим их исправления в соответствии с условиями, указанными в Free Support Policies.
Идентификатор(ы) проблемы: DIAGRAMAPP-2235
Вы можете получить Paid Support Services, если вам нужна приоритетная поддержка, а также прямой доступ к нашей команде управления платной поддержкой.
Adding a hyperlink to a figure, you mean like embedding a clickable image that directs to a URL?
Or are you asking if it’s possible to link the figure’s metadata to a web address?
Because, technically, linking a figure to a URL could involve different methods depending on the platform—HTML, PDFs, or even software tools, right? So, yeah, it’s doable, but the ‘how’ might vary.
Adding a hyperlink directly from the UI of Aspose Visio Editor is not supported at the moment. However, you can embed a URL into a shape programmatically by using Aspose.Diagram and then load the updated diagram back into the editor.
Below is a minimal example for .NET that adds a hyperlink to a shape with a known ID (or index). Adjust the shape selection logic as needed for your diagram.
using Aspose.Diagram;
// Load the Visio file (it can be the document you obtained from the editor)
Diagram diagram = new Diagram("input.vsdx");
// Find the shape you want to link – here we use the first shape on the first page
Shape shape = diagram.Pages[0].Shapes[0];
// Create a new hyperlink object
Hyperlink link = new Hyperlink
{
URL = "https://www.example.com",
Description = "Open example site",
NewWindow = true // opens in a new browser window/tab
};
// Add the hyperlink to the shape
shape.Hyperlinks.Add(link);
// Save the updated diagram (the editor can reload this file)
diagram.Save("output.vsdx", SaveFileFormat.VSDX);
After saving the file, you can open it again in Aspose Visio Editor; the shape will behave as a clickable hyperlink when the diagram is exported to a format that supports links (e.g., HTML or PDF). If you need to add hyperlinks to multiple shapes, iterate over the desired shapes and apply the same pattern.