从网络注释 VST


下载免费试用版

关于 GroupDocs.Net API 注释

GroupDocs.Annotation for Net API 是一个库,允许您在 Mac、Windows 或 Ubuntu 上向 PDF、Word 和其他文档添加注释。 GroupDocs.Annotation for Net 是一个用于管理注释的原生 Net API,全面支持从图像和各种其他文档中创建、添加、编辑、删除、提取和导出注释。您可以在此页面上看到支持的文档格式的完整列表。 该库不仅允许您处理 VST 文档,还可以处理许多其他类型的文档,例如 Word、Excel、PowerPoint、Outlook 电子邮件、Visio、Adobe、OpenDocument、OpenOffice、Photoshop、AutoCad 等。 GroupDocs.Annotation for Net API 允许您创建和添加新注释、编辑注释、提取注释、注释以及从文档中删除它们。该库支持 13 种不同的注释类型,包括文本、折线、区域、下划线、点、水印、箭头、椭圆、文本替换、距离、文本字段、PDF、HTML、Microsoft Word 文档、电子表格、图表、演示文稿中的资源编辑,绘图、图像和许多其他文件格式。 该示例(请参见下文)演示了如何使用 VST 文档,在此示例中您可以看到如何使用 GroupDocs 的主要步骤。注释:设置许可证、打开要使用的文档、创建注释,根据需要添加数据对象设置注释属性,并将结果保存到需要的地方。您还可以在我们的 github 页面 或我们的产品 [文档](https://docs.groupdocs.com/annotation/net/getting-started/)。

在 Net 中向 VST 添加注释的步骤

GroupDocs.Annotation 通过实施几个简单的步骤,网络开发人员可以轻松地将各种注释类型添加到任何基于网络的应用程序中的 VST 文件。

  • 创建带有评论和日期的 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 中从 VST 中删除注释的步骤

GroupDocs.Annotation 通过实施几个简单的步骤,网络开发人员可以更轻松地从任何基于网络的应用程序中的 VST 文件中删除注释详细信息。

  • 创建带有评论和日期的 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 中编辑 VST 注释的步骤

GroupDocs.Annotation 通过实施几个简单的步骤,网络开发人员可以更轻松地从任何基于网络的应用程序中的 VST 文件更新各种注释属性。

  • 使用输入文档路径或流实例化 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 中的 VST 提取注释的步骤

GroupDocs.Annotation 通过实施几个简单的步骤,网络开发人员可以轻松地对文档进行注释并从任何基于网络的应用程序中的 VST 文件中提取注释信息。

  • 创建带有评论和日期的 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 现场演示 网站,向 VST 文件添加、删除、编辑和提取注释。 现场演示有以下好处

无需下载 API

无需编写任何代码

只需上传源文件

获取下载链接以保存文件

关于 VST 文件格式

带有 VST 扩展名的文件是使用 Microsoft Visio 创建的矢量图像文件,可用作创建其他文件的模板。这些模板文件采用二进制文件格式,包含用于创建新 Visio 绘图的默认布局和设置。在 Microsoft Visio 中打开 VST 文件时,它包含继续处理文档的现有设置。一般来说,Visio 文件用于创建包含可视对象、流程图、UML 图、信息流、组织结构图、软件图表、网络布局、数据库模型、对象映射和其他类似信息的绘图。使用 Visio 生成的文件还可以导出为不同的文件格式,例如 PNG、BMP、PDF 等。

阅读更多 关于 VST 文件格式

使用其他流行的文档格式

更新一些流行文件格式的注释属性,如下所述。

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
 中国人