Explore nuestros productos

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

Instalación

El paquete está disponible en nuget.org y se puede instalar desde la consola del Administrador de paquetes con el siguiente comando:

NuGet\Install-Package GroupDocs.Annotation-Cloud

Version NuGet NuGet-GroupDocsCloud


Requisitos

  • .NET Framework 2.0 o .NET Standard 2.0
  • NuGet
  • System.Web al dirigirse a .NET Framework 2.0
  • Credenciales de GroupDocs Cloud — Client ID and Client Secret del panel

Inicio rápido

Obtener las credenciales de API

Para usar GroupDocs.Annotation Cloud, regístrese en el panel de GroupDocs.Cloud y obtenga el Client ID y el Client Secret.

Inicializar la API

Use el código siguiente para empezar a usar 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);

Vea el ejemplo completo en Constants.cs.

Agregar un resaltado de texto

Este ejemplo agrega un resaltado de texto a un documento de Word en el almacenamiento en la nube.

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);

Vea el ejemplo completo en AddTextHighlightAnnotation.cs.

Agregar una anotación de área

Este ejemplo agrega una anotación de área a la primera 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);

Vea el ejemplo completo en AddAreaAnnotation.cs.

Eliminar anotaciones

Este ejemplo quita las anotaciones 1, 2 y 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);

Vea el ejemplo completo en DeleteAnnotations.cs.

Extraer anotaciones

Este ejemplo lee las anotaciones de un 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);

Vea el ejemplo completo en ExtractAnnotations.cs.

Obtener los formatos de archivo admitidos

Recupere los formatos que acepta la API de 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);

Vea el ejemplo completo en GetSupportedFormats.cs.

Ejemplos en GitHub

El repositorio GroupDocs.Annotation Cloud .NET Examples incluye ejemplos listos para ejecutar sobre:

CategoryExamples
AgregarÁrea, flecha, distancia, elipse, imagen, vínculo, punto, polilínea, resaltado de texto, subrayado, tachado, redacción, marca de agua
AdministrarEliminar anotaciones, extraer anotaciones, anotación directa
InfoInformación del documento, formatos admitidos
Vista previaObtener páginas, eliminar páginas

Cómo ejecutar los ejemplos

  1. Clone o descargue el repositorio de ejemplos
  2. Abra Examples/GroupDocs.Annotation.Cloud.Examples.sln en Visual Studio 2017 o posterior
  3. Haga clic con el botón derecho en la solución y seleccione Enable NuGet Package Restore
  4. Edite Examples/GroupDocs.Annotation.Cloud.Examples/Program.cs y establezca Constants.MyClientId y Constants.MyClientSecret
  5. Compile y ejecute

Para obtener más detalles, visite Getting Started.


Product Docs Swagger Examples Blog Support Dashboard




 Español