Browse our Products

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

Installation

Le package est disponible sur npmjs.com et peut être installé via npm en exécutant la commande suivante :

npm install groupdocs-annotation-cloud

NPM Version NPM Downloads NPM-GroupDocsCloud


Exigences

Dépendances

Le SDK nécessite les packages suivants :

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

Démarrage rapide

Obtenez vos identifiants API

Pour utiliser GroupDocs.Annotation Cloud, inscrivez-vous sur le GroupDocs.Cloud Dashboard et obtenez votre Client ID et votre Client Secret.

Initialisez l’API

Utilisez le code suivant pour commencer à utiliser 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);

Voir l’exemple complet dans RunExamples.js.

Ajouter une annotation de champ de texte

Une fois l’API initialisée, utilisez cet exemple de base pour ajouter une annotation de champ de texte à un document 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);
})();

Voir l’exemple complet dans AddTextFieldAnnotation.js.

Ajouter une annotation de zone

Cet exemple ajoute une annotation de zone à un document 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);
})();

Voir l’exemple complet dans AddAreaAnnotation.js.

Extraire les annotations

Cet exemple renvoie les annotations enregistrées dans un document.

"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);
})();

Voir l’exemple complet dans ExtractAnnotations.js.

Supprimer des annotations

Cet exemple supprime les annotations 1, 2 et 3 d’un document.

"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);
})();

Voir l’exemple complet dans DeleteAnnotations.js.

Obtenir les formats d’annotation pris en charge

Récupérez les formats de document que l’API peut annoter.

"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);
})();

Voir l’exemple complet dans GetSupportedFormats.js.

Exemples sur GitHub

Le dépôt GroupDocs.Annotation Cloud Node.js Examples contient des exemples prêts à exécuter couvrant :

CategoryExamples
Add AnnotationChamp de texte, surlignage, soulignement, barré, ligne ondulée, remplacement, caviardage, zone, flèche, distance, ellipse, image, lien, point, polyligne, filigrane
Extract and RemoveExtraire les annotations, supprimer des annotations par identifiant
PreviewObtenir les pages, supprimer des pages
Basic UsageInformations sur le document, formats pris en charge, opérations sur les fichiers, les dossiers et le stockage

Comment exécuter les exemples

  1. Clonez ou téléchargez le dépôt d’exemples
  2. Modifiez Examples/RunExamples.js et définissez clientId et clientSecret
  3. Accédez au répertoire Examples
  4. Exécutez npm install
  5. Exécutez npm update
  6. Exécutez npm run-script start

Pour plus de détails, consultez 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



 Français