從網絡註釋 VSD


下載免費試用版

關於 GroupDocs.Net API 註釋

GroupDocs.Annotation for Net API 是一個庫,允許您在 Mac、Windows 或 Ubuntu 上向 PDF、Word 和其他文檔添加註釋。 GroupDocs.Annotation for Net 是一個用於管理註釋的原生 Net API,全面支持從圖像和各種其他文檔中創建、添加、編輯、刪除、提取和導出註釋。您可以在此頁面上看到支持的文檔格式的完整列表。 該庫不僅允許您處理 VSD 文檔,還可以處理許多其他類型的文檔,例如 Word、Excel、PowerPoint、Outlook 電子郵件、Visio、Adobe、OpenDocument、OpenOffice、Photoshop、AutoCad 等。 GroupDocs.Annotation for Net API 允許您創建和添加新註釋、編輯註釋、提取註釋、註釋以及從文檔中刪除它們。該庫支持13 種不同的註釋類型,包括文本、折線、區域、下劃線、點、水印、箭頭、橢圓、文本替換、距離、文本字段、PDF、HTML、Microsoft Word 文檔、電子表格、圖表、演示文稿中的資源編輯,繪圖、圖像和許多其他文件格式。 該示例(請參見下文)演示瞭如何使用 VSD 文檔,在此示例中您可以看到如何使用 GroupDocs 的主要步驟。註釋:設置許可證、打開要使用的文檔、創建註釋,根據需要添加數據對象設置註釋屬性,並將結果保存到需要的地方。您還可以在我們的 github 頁面 或我們的產品 [文檔](https://docs.groupdocs.com/annotation/net/getting-started/)。

在 Net 中向 VSD 添加註釋的步驟

GroupDocs.Annotation 通過實施幾個簡單的步驟,網絡開發人員可以輕鬆地將各種註釋類型添加到任何基於網絡的應用程序中的 VSD 文件。

  • 創建帶有評論和日期的 Reply 對象。
  • 創建 AreaAnnotation 對象,設置區域選項並添加回复。
  • 創建 Annotator 對象並添加區域註釋。
  • 保存輸出文件。

系統要求

所有主要平台和操作系統均支持 GroupDocs.Annotation for Net API。在執行下面的代碼之前,請確保您的系統上安裝了以下先決條件。

  • 操作系統:Microsoft Windows、Linux、MacOS
  • 開發環境:Visual Studio、Xamarin、MonoDevelop
  • 框架:.NET Framework、.NET Standard、.NET Core、Mono
  • NuGet 下載最新版本的 GroupDocs.Annotation for .NET

註釋預覽和代碼示例

//Add text field annotation to the document from local disk
using (Annotator annotator = new Annotator("input.bmp"))
{
    TextFieldAnnotation textField = new TextFieldAnnotation
    {
        BackgroundColor = 65535,
        Box = new Rectangle(100, 100, 100, 100),
        CreatedOn = DateTime.Now,
        Text = "Some text",
        FontColor = 65535,
        FontSize = 12,
        Message = "This is text field annotation",
        Opacity = 0.7,
        PageNumber = 0,
        PenStyle = PenStyle.Dot,
        PenWidth = 3,
        FontFamily = "Arial",
        TextHorizontalAlignment = HorizontalAlignment.Center,
        Replies = new List
        {
            new Reply
            {
                Comment = "First comment",
                RepliedOn = DateTime.Now
            },
            new Reply
            {
                Comment = "Second comment",
                RepliedOn = DateTime.Now
            }
        }
    };
    annotator.Add(textField);
    annotator.Save("result.bmp");
}

Annotation preview image

在 Net 中從 VSD 中刪除註釋的步驟

GroupDocs.Annotation 通過實施幾個簡單的步驟,網絡開發人員可以更輕鬆地從任何基於網絡的應用程序中的 VSD 文件中刪除註釋詳細信息。

  • 創建帶有評論和日期的 Reply 對象。
  • 實例化 SaveOptions 對象並設置 AnnotationTypes = AnnotationType.None。
  • 使用生成的文檔路徑或流以及 SaveOptions 對象調用 save 方法。

// 1- How to remove annotation from document using annotation index

using (Annotator annotator = new Annotator("result.bmp"))
{
    annotator.Remove(0);
    annotator.Save("removed.bmp");
}

// 2- How to remove annotation from document using annotation object

using (Annotator annotator = new Annotator("result.bmp"))
{
    var tmp = annotator.Get();
    annotator.Remove(tmp[0]);
    annotator.Save("removed.bmp");
}

// 3- How to remove some annotations from document using list of ID’s

using (Annotator annotator = new Annotator("result.bmp"))
{
    var idList = new List{1, 2, 3};
    annotator.Remove(idList);
    annotator.Save("removed.bmp");
}

// 4- How to remove some annotations from document using list of annotations

using (Annotator annotator = new Annotator("result.bmp"))
{
    var tmp = annotator.Get();
    annotator.Remove(tmp);
    annotator.Save("removed.bmp");
}

在 Net 中編輯 VSD 註釋的步驟

GroupDocs.Annotation 通過實施幾個簡單的步驟,網絡開發人員可以更輕鬆地從任何基於網絡的應用程序中的 VSD 文件更新各種註釋屬性。

  • 使用輸入文檔路徑或流實例化 Annotator 對象,並使用 ImportAnnotations = true 實例化 LoadOptions。
  • 創建一些 AnnotationBase 實現並設置現有註釋的 Id(如果未找到具有該 Id 的註釋,則不會更改任何內容)或註釋的路徑列表(所有現有註釋將被刪除)。
  • 使用傳遞的註釋調用 Annotator 對象的更新方法。
  • 使用生成的文檔路徑或流以及 SaveOptions 對象調用 save 方法。

// open annotated document
using (Annotator annotator = new Annotator("result.bmp"))
{
    //assuming we are going to change some properties of existing annotation
        AreaAnnotation updated = new AreaAnnotation
            {
                    // It's important to set existed annotation Id
                    Id = 1,
                    BackgroundColor = 255,
                    Box = new Rectangle(0, 0, 50, 200),
                    CreatedOn = DateTime.Now,
                    Message = "This is updated annotation",
                    Replies = new List
                    {
                        new Reply
                        {
                            Comment = "Updated first comment",
                            RepliedOn = DateTime.Now
                        },
                        new Reply
                        {
                            Comment = "Updated second comment",
                            RepliedOn = DateTime.Now
                        }
                    }
                };
        // update annotation
        annotator.Update(updated);
        annotator.Save("result.bmp");
}

從 Net 中的 VSD 提取註釋的步驟

GroupDocs.Annotation 通過實施幾個簡單的步驟,網絡開發人員可以輕鬆地對文檔進行註釋並從任何基於網絡的應用程序中的 VSD 文件中提取註釋信息。

  • 創建帶有評論和日期的 Reply 對象。
  • 實例化 LoadOptions 對象並使用 true 參數調用 SetImportAnnotations。
  • 定義類型為 List 的變量。
  • 調用 get 方法並將結果返回到上面的變量。

// for using this example input file ("annotated.bmp") must be with annotations
using (Annotator annotator = new Annotator("annotated.bmp"))
{
    List annotations = annotator.Get();
    XmlSerializer formatter = new XmlSerializer(typeof(List));
    using (FileStream fs = new FileStream("annotations.xml", FileMode.Create))
    {
        fs.SetLength(0);
        formatter.Serialize(fs, annotations);
    }
}

現場演示添加、刪除、編輯、提取文檔和圖像的註釋

立即訪問 GroupDocs.Annotation 現場演示 網站,向 VSD 文件添加、刪除、編輯和提取註釋。 現場演示有以下好處

無需下載API

無需編寫任何代碼

只需上傳源文件即可

獲取下載鏈接以保存文件

關於 VSD 文件格式

VSD 文件是使用 Microsoft Visio 應用程序創建的圖形,用於表示各種圖形對像以及它們之間的互連。此類繪圖可以包含視覺對象,例如視覺對象、流程圖、UML圖、信息流、組織圖、軟件圖、網絡佈局、數據庫模型、對象映射和其他類似信息。 Microsoft Visio 提供將 Visio 文件轉換為多種不同文件格式的功能,包括 PNG、BMP、PDF 等。

閱讀更多 關於 VSD 文件格式

使用其他流行的文檔格式

更新一些流行文件格式的註釋屬性,如下所述。

Annotate PDF document

(Adobe Portable Document Format)

Annotate DOC document

(Microsoft Word Document)

Annotate DOCM document

(Microsoft Word Macro-Enabled Document)

Annotate DOCX document

(Microsoft Word Open XML Document)

Annotate DOT document

(Microsoft Word Document Template)

Annotate DOTX document

(Word Open XML Document Template)

Annotate RTF document

(Rich Text Document)

Annotate ODT document

(Open Document Text)

Annotate XLS document

(Microsoft Excel Binary File Format)

Annotate XLSX document

(Microsoft Excel Open XML Spreadsheet)

Annotate XLSM document

(Microsoft Excel Macro-Enabled Spreadsheet)

Annotate XLSB document

(Microsoft Excel Binary Worksheet)

Annotate ODS document

(Open Document Spreadsheet)

Annotate PPT document

(PowerPoint Presentation)

Annotate PPTX document

(PowerPoint Open XML Presentation)

Annotate PPSX document

(PowerPoint Open XML Slide Show)

Annotate POTM document

(Microsoft PowerPoint Template)

Annotate PPTM document

(Microsoft PowerPoint Presentation)

Annotate PPS document

(Microsoft PowerPoint 97-2003 Slide Show)

Annotate ODP document

(OpenDocument Presentation)

Annotate HTML document

(HyperText Markup Language)

Annotate TIFF document

(Tagged Image File Format)

Annotate PNG document

(Portable Network Graphic)

Annotate EML document

(E-mail Message)

Annotate MSG document

(Microsoft Outlook E-mail Message)

Annotate VSD document

(Microsoft Visio 2003-2010 Drawing)

Annotate VSDX document

(Microsoft Visio Drawing)

Annotate VSS document

(Microsoft Visio 2003-2010 Stencil)

Annotate VST document

(Microsoft Visio 2013 Stencil)

Annotate DWG document

(Autodesk Design Data Formats)

Annotate DXF document

(AutoCAD Drawing Interchange)

Annotate DCM document

(Digital Imaging and Communications in Medicine)

Annotate WMF document

(Windows Metafile)

Annotate EMF document

(Enhanced Metafile Format)

Back to top
 中文(繁體)