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 npmjs.com e pode ser instalado via npm executando o seguinte comando:

npm install groupdocs-annotation-cloud

NPM Version NPM Downloads NPM-GroupDocsCloud


Requisitos

Dependências

O SDK requer os seguintes pacotes:

PackageConstraint
axios1.8.4
form-data*
jsonwebtoken9.0.1
qs6.11.2

Início rápido

Obtenha suas credenciais de API

Para usar o GroupDocs.Annotation Cloud, cadastre-se no GroupDocs.Cloud Dashboard e obtenha seu Client ID e Client Secret.

Inicialize a API

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

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const annotateApi = annotation_cloud.AnnotateApi.fromConfig(config);

Veja o exemplo completo em RunExamples.js.

Adicionar uma anotação de campo de texto

Depois de inicializada, use este exemplo básico para adicionar uma anotação de campo de texto a um documento do Word.

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const annotateApi = annotation_cloud.AnnotateApi.fromConfig(config);

(async () => {
    let a1 = new annotation_cloud.AnnotationInfo();
    a1.annotationPosition = new annotation_cloud.Point();
    a1.annotationPosition.x = 1;
    a1.annotationPosition.y = 1;
    a1.box = new annotation_cloud.Rectangle();
    a1.box.x = 100;
    a1.box.y = 100;
    a1.box.width = 200;
    a1.box.height = 100;
    a1.pageNumber = 0;
    a1.fontColor = 65535;
    a1.fontSize = 12;
    a1.type = annotation_cloud.AnnotationInfo.TypeEnum.TextField;
    a1.text = "Text field text";
    a1.creatorName = "Anonym A.";

    let fileInfo = new annotation_cloud.FileInfo();
    fileInfo.filePath = "annotationdocs\\one-page.docx";
    let options = new annotation_cloud.AnnotateOptions();
    options.fileInfo = fileInfo;
    options.annotations = [a1];
    options.outputPath = "Output/output.docx";
    let result = await annotateApi.annotate(new annotation_cloud.AnnotateRequest(options));
    console.log("AddTextFieldAnnotation: Text Field Annotation added: " + result.href);
})();

Veja o exemplo completo em AddTextFieldAnnotation.js.

Adicionar uma anotação de área

Este exemplo adiciona uma anotação de área a um documento do Word.

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const annotateApi = annotation_cloud.AnnotateApi.fromConfig(config);

(async () => {
    let a1 = new annotation_cloud.AnnotationInfo();
    a1.annotationPosition = new annotation_cloud.Point();
    a1.annotationPosition.x = 1;
    a1.annotationPosition.y = 1;
    a1.box = new annotation_cloud.Rectangle();
    a1.box.x = 100;
    a1.box.y = 100;
    a1.box.width = 200;
    a1.box.height = 100;
    a1.pageNumber = 0;
    a1.penColor = 1201033;
    a1.penStyle = annotation_cloud.AnnotationInfo.PenStyleEnum.Solid;
    a1.penWidth = 1;
    a1.type = annotation_cloud.AnnotationInfo.TypeEnum.Area;
    a1.text = "This is area annotation";
    a1.creatorName = "Anonym A.";

    let fileInfo = new annotation_cloud.FileInfo();
    fileInfo.filePath = "annotationdocs\\one-page.docx";
    let options = new annotation_cloud.AnnotateOptions();
    options.fileInfo = fileInfo;
    options.annotations = [a1];
    options.outputPath = "Output/output.docx";
    let result = await annotateApi.annotate(new annotation_cloud.AnnotateRequest(options));
    console.log("AddAreaAnnotation: Area Annotation added: " + result.href);
})();

Veja o exemplo completo em AddAreaAnnotation.js.

Extrair anotações

Este exemplo retorna as anotações armazenadas em um documento.

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const annotateApi = annotation_cloud.AnnotateApi.fromConfig(config);

(async () => {
    let fileInfo = new annotation_cloud.FileInfo();
    fileInfo.filePath = "input\\input.docx";
    let result = await annotateApi.extract(new annotation_cloud.ExtractRequest(fileInfo));
    console.log("GetAnnotations: annotations count = " + result.length);
})();

Veja o exemplo completo em ExtractAnnotations.js.

Remover anotações

Este exemplo exclui as anotações 1, 2 e 3 de um documento.

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const annotateApi = annotation_cloud.AnnotateApi.fromConfig(config);

(async () => {
    let fileInfo = new annotation_cloud.FileInfo();
    fileInfo.filePath = "input\\input.docx";
    let options = new annotation_cloud.RemoveOptions();
    options.fileInfo = fileInfo;
    options.annotationIds = [1, 2, 3];
    options.outputPath = "Output/output.docx";
    let result = await annotateApi.removeAnnotations(new annotation_cloud.RemoveAnnotationsRequest(options));
    console.log("DeleteAnnotations: annotations delete: " + result.href);
})();

Veja o exemplo completo em DeleteAnnotations.js.

Obter os formatos de anotação compatíveis

Recupere os formatos de documento que a API pode anotar.

"use strict";
const annotation_cloud = require("groupdocs-annotation-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new annotation_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const infoApi = annotation_cloud.InfoApi.fromConfig(config);

(async () => {
    let response = await infoApi.getSupportedFileFormats();
    console.log("Formats count: " + response.formats.length);
})();

Veja o exemplo completo em GetSupportedFormats.js.

Exemplos no GitHub

O repositório GroupDocs.Annotation Cloud Node.js Examples inclui exemplos prontos para executar que abrangem:

CategoryExamples
Add AnnotationCampo de texto, realce, sublinhado, tachado, linha ondulada, substituição, redação, área, seta, distância, elipse, imagem, link, ponto, polilinha, marca d’água
Extract and RemoveExtrair anotações, remover anotações por id
PreviewObter páginas, excluir páginas
Basic UsageInformações do documento, formatos compatíveis, operações de arquivo, pasta e armazenamento

Como executar os exemplos

  1. Clone ou baixe o repositório de exemplos
  2. Edite Examples/RunExamples.js e defina clientId e clientSecret
  3. Vá para o diretório Examples
  4. Execute npm install
  5. Execute npm update
  6. Execute npm run-script start

Para mais detalhes, visite Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Annotation API | Node.js Cloud API | GroupDocs.Annotation Cloud | REST API | Text Annotation | Area Annotation | Highlight Annotation | Remove Annotations | Extract Annotations | Document Information | Cloud Storage Integration | Secure API Access



 Português