Convert Visio to PDF format

Export to PDF

This article explains how to export a Microsoft Visio diagram to PDF using Aspose.Diagram for .NET API.

使用Diagram类构造函数读取 diagram 文件和 Save 方法将 diagram 导出为任何支持的图像格式。

The image below shows the VSD diagram that the code snippets below export PDF. You can use other diagram formats (VSS, VSSM, VDX, VST, VSTX, VDX, VTX or VSX) as well.

源文件。
待办事项:图片_替代_文本

To export VSD diagram to PDF:

  1. 创建 Diagram 类的实例。
  2. Call the Diagram classs Save method and set the output format to PDF.

Below is an image of the output PDF file.

输出PDF文件。
待办事项:图片_替代_文本

Export Microsoft Visio Drawing to PDF

The code samples show how to export Microsoft Visio Drawing to PDF using C#.

拆分多个页面

Aspose.Diagram for .NET allows splitting multiple pages while converting the Microsoft Visio Diagram to PDF. The following code snippet shows the functionality.  

使用页面保存回调

In case you have multiple pages, Aspose.Diagram for .NET allows using page saving callback while converting the Microsoft Visio Diagram to PDF. The following code snippet shows the functionality.  

TestDiagramPageSavingCallback 类

公共类 TestDiagramPageSavingCallback Aspose.Diagram.Saving.IPageSavingCallback

{
 
 public void PageStartSaving(Aspose.Diagram.Saving.PageStartSavingArgs args)
 
 {
 
 Console.WriteLine("开始保存 diagram 页 {0} of pages {1}", args.PageIndexs + PageIndexs + Paged_0, ar 
 }
 
 public void PageEndSaving(Aspose.Diagram.Saving.PageEndSavingArgs args)
 
 {
 
 Console.WriteLine("结束保存 diagram 页 {0} of pages {1}", In arg +Page.Page.Page 
 
 //don't output pages after page index 8.
 
 if (args.PageIndex >= 8)
 
 {
 
 args.HasMorePages = false;
 
 }
 
 }
 
 }