Navegue pelos nossos produtos

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Instalação

O pacote está disponível em nuget.org e pode ser instalado pelo Console do Gerenciador de Pacotes com o seguinte comando:

NuGet\Install-Package GroupDocs.Annotation-Cloud

Version NuGet NuGet-GroupDocsCloud


Requisitos

  • .NET Framework 2.0 ou .NET Standard 2.0
  • NuGet
  • System.Web ao direcionar para o .NET Framework 2.0
  • Credenciais do GroupDocs Cloud — Client ID and Client Secret do painel

Início rápido

Obter as credenciais de API

Para usar o GroupDocs.Annotation Cloud, inscreva-se no painel do GroupDocs.Cloud e obtenha o Client ID e o Client Secret.

Inicializar a API

Use o código a seguir para começar a usar o GroupDocs.Annotation Cloud SDK for .NET.

using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;

string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";

var config = new Configuration(MyClientId, MyClientSecret);
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new AnnotateApi(config);

Veja o exemplo completo em Constants.cs.

Adicionar um realce de texto

Este exemplo adiciona um realce de texto a um documento do Word no armazenamento em nuvem.

using System;
using System.Collections.Generic;
using System.Linq;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);

var options = new AnnotateOptions
{
    FileInfo = new FileInfo { FilePath = "one-page.docx" },
    Annotations = new List<AnnotationInfo>
    {
        new AnnotationInfo
        {
            Points = new List<Point>
            {
                new Point { X = 80, Y = 730 }, new Point { X = 240, Y = 730 },
                new Point { X = 80, Y = 650 }, new Point { X = 240, Y = 650 }
            },
            BackgroundColor = 65535,
            PageNumber = 0,
            Type = AnnotationInfo.TypeEnum.TextHighlight,
            Text = "This is text highlight annotation",
            CreatorName = "Anonym A."
        }
    },
    OutputPath = "Output/output.docx"
};

var link = apiInstance.Annotate(new AnnotateRequest(options));
Console.WriteLine("AddTextHighlightAnnotation: Text highlight Annotation added: " + link.Title);

Veja o exemplo completo em AddTextHighlightAnnotation.cs.

Adicionar uma anotação de área

Este exemplo adiciona uma anotação de área à primeira página.

using System.Collections.Generic;
using System.Linq;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);

var options = new AnnotateOptions
{
    FileInfo = new FileInfo { FilePath = "one-page.docx" },
    Annotations = new List<AnnotationInfo>
    {
        new AnnotationInfo
        {
            AnnotationPosition = new Point { X = 1, Y = 1 },
            Box = new Rectangle { X = 100, Y = 100, Width = 100, Height = 100 },
            PageNumber = 0,
            Type = AnnotationInfo.TypeEnum.Area,
            Text = "This is area annotation",
            CreatorName = "Anonym A."
        }
    },
    OutputPath = "Output/output.docx"
};

var link = apiInstance.Annotate(new AnnotateRequest(options));
Console.WriteLine("AddAreaAnnotation: Area Annotation added: " + link.Title);

Veja o exemplo completo em AddAreaAnnotation.cs.

Excluir anotações

Este exemplo remove as anotações 1, 2 e 3.

using System.Collections.Generic;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);

var options = new RemoveOptions
{
    FileInfo = new FileInfo { FilePath = "one-page.docx" },
    AnnotationIds = new List<int?> { 1, 2, 3 },
    OutputPath = "Output/output.docx"
};

var link = apiInstance.RemoveAnnotations(new RemoveAnnotationsRequest(options));
Console.WriteLine("DeleteAnnotations: Annotations deleted: " + link.Title);

Veja o exemplo completo em DeleteAnnotations.cs.

Extrair anotações

Este exemplo lê as anotações de um documento.

using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);

var response = apiInstance.Extract(new ExtractRequest(new FileInfo { FilePath = "input.docx" }));
Console.WriteLine("ExtractAnnotations: annotations count = " + response.Count);

Veja o exemplo completo em ExtractAnnotations.cs.

Obter os formatos de arquivo compatíveis

Recupere os formatos aceitos pela API annotation.

using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new InfoApi(config);

var response = apiInstance.GetSupportedFileFormats();
Console.WriteLine("GetSupportedFormats: formats count = " + response.Formats.Count);

Veja o exemplo completo em GetSupportedFormats.cs.

Exemplos no GitHub

O repositório GroupDocs.Annotation Cloud .NET Examples inclui exemplos prontos para executar sobre:

CategoryExamples
AdicionarÁrea, seta, distância, elipse, imagem, link, ponto, polilinha, realce de texto, sublinhado, tachado, redação, marca d’água
GerenciarExcluir anotações, extrair anotações, anotação direta
InfoInformações do documento, formatos compatíveis
Pré-visualizaçãoObter páginas, excluir páginas

Como executar os exemplos

  1. Clone ou baixe o repositório de exemplos
  2. Abra Examples/GroupDocs.Annotation.Cloud.Examples.sln no Visual Studio 2017 ou posterior
  3. Clique com o botão direito do mouse na solução e selecione Enable NuGet Package Restore
  4. Edite Examples/GroupDocs.Annotation.Cloud.Examples/Program.cs e defina Constants.MyClientId e Constants.MyClientSecret
  5. Compile e execute

Para mais detalhes, visite Getting Started.


Product Docs Swagger Examples Blog Support Dashboard




 Português