在 Ruby 中将超链接添加到 Visio 形状
Contents
[
Hide
]
Aspose.Diagram - 添加超链接
添加超链接使用Aspose.Diagram Java 红宝石 只需调用添加超链接到形状模块。在这里您可以看到示例代码。
红宝石代码
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
\# Create instance of Diagram
diagram = Rjb::import('com.aspose.diagram.Diagram').new(data_dir + "Drawing.vsd")
\# Initialize Hyperlink object
hyperlink = Rjb::import('com.aspose.diagram.Hyperlink').new
\# Set address value
hyperlink.getAddress().setValue("http://www.google.com/")
\# Set sub address value
hyperlink.getSubAddress().setValue("Sub address here")
\# Set description value
hyperlink.getDescription().setValue("Description here")
\# Set name
hyperlink.setName("MyHyperLink")
\# Add hyperlink to the shape
diagram.getPages().getPage("Flow 1").getShapes().getShape(1).getHyperlinks().add(hyperlink)
\# Save diagram
diagram.save(data_dir + "Hyperlinks.vdx", Rjb::import('com.aspose.diagram.SaveFileFormat').VDX)
puts "Added hyperlik to shape successfully!"
下载运行代码
下载**将超链接添加到 Visio 形状 (Aspose.Diagram)**来自以下任何社交编码网站: