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.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.

Installation
Das Paket ist verfügbar bei Packagist und kann über Composer mit folgendem Befehl installiert werden:
composer require groupdocscloud/groupdocs-annotation-cloud

Anforderungen
- PHP 8.2 oder höher
- Composer
- PHP-Erweiterungen — curl, json, mbstring
- GroupDocs Cloud-Anmeldeinformationen — Client ID and Client Secret vom Dashboard
Abhängigkeiten
Das SDK benötigt die folgenden Pakete:
| Package | Constraint |
|---|
| guzzlehttp/guzzle | ^6.5.8 or ^7.4.5 |
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
Schnellstart
Um GroupDocs.Annotation Cloud zu verwenden, registrieren Sie sich im GroupDocs.Cloud Dashboard und holen Sie sich Ihre Client ID und Client Secret.
API initialisieren
Verwenden Sie den folgenden Code, um mit dem GroupDocs.Annotation Cloud SDK für PHP zu beginnen:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
Siehe das vollständige Beispiel in Utils.php.
Textfeldanmerkung hinzufügen
Nach der Initialisierung können Sie mit diesem einfachen Beispiel eine Textfeldanmerkung zu einem in GroupDocs Cloud gespeicherten Word-Dokument hinzufügen.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$a = new Model\AnnotationInfo();
$pt = new Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new Model\Rectangle();
$box->setX(100);
$box->setY(100);
$box->setWidth(200);
$box->setHeight(100);
$a->setBox($box);
$a->setPageNumber(0);
$a->setFontColor(1201033);
$a->setFontSize(12);
$a->setOpacity(0.7);
$a->setType(Model\AnnotationInfo::TYPE_TEXT_FIELD);
$a->setText("Text field text");
$a->setCreatorName("Anonym A.");
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
$options = new Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\annotateRequest($options);
$result = $annotateApi->annotate($request);
echo "Text field annotation added: " . $result->getHref() . "\n";
Siehe das vollständige Beispiel in AddTextFieldAnnotation.php.
Bereichsanmerkung hinzufügen
Dieses Beispiel fügt einem Word-Dokument eine Bereichsanmerkung hinzu.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$a = new Model\AnnotationInfo();
$pt = new Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new Model\Rectangle();
$box->setX(100);
$box->setY(100);
$box->setWidth(200);
$box->setHeight(100);
$a->setBox($box);
$a->setPageNumber(0);
$a->setPenColor(1201033);
$a->setPenStyle(Model\AnnotationInfo::PEN_STYLE_SOLID);
$a->setPenWidth(1);
$a->setOpacity(0.7);
$a->setType(Model\AnnotationInfo::TYPE_AREA);
$a->setText("This is area annotation");
$a->setCreatorName("Anonym A.");
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
$options = new Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\annotateRequest($options);
$result = $annotateApi->annotate($request);
echo "Area annotation added: " . $result->getHref() . "\n";
Siehe das vollständige Beispiel in AddAreaAnnotation.php.
Anmerkungen entfernen
Dieses Beispiel entfernt die Anmerkungen 1, 2 und 3 aus einem Dokument.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("input\\input.docx");
$options = new Model\RemoveOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotationIds([1, 2, 3]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\removeAnnotationsRequest($options);
$result = $annotateApi->removeAnnotations($request);
echo "Annotations deleted: " . $result->getHref() . "\n";
Siehe das vollständige Beispiel in DeleteAnnotations.php.
Rufen Sie die unterstützten Anmerkungsformate ab.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$infoApi = new GroupDocs\Annotation\InfoApi($configuration);
$response = $infoApi->getSupportedFileFormats();
foreach ($response->getFormats() as $format) {
echo $format->getFileFormat() . " - " . $format->getExtension() . "\n";
}
Siehe das vollständige Beispiel in GetSupportedFormats.php.
Beispiele auf GitHub
Das Repository GroupDocs.Annotation Cloud PHP Examples enthält sofort ausführbare Beispiele für:
| Category | Examples |
|---|
| Anmerkungen hinzufügen | Textfeld, Bereich, Pfeil, Distanz, Ellipse, Bild, Link, Punkt, Polylinie, Ressourcenschwärzung, Zickzack, Hervorhebung, Austausch, Durchstreichung, Unterstreichung, Wasserzeichen; mehrere Anmerkungen; direkte Anmerkung |
| Anmerkungen verwalten | Anmerkungen extrahieren, Anmerkungen löschen |
| Dokumentvorschau | Seiten abrufen, Seiten löschen |
| Grundlegende Nutzung | Unterstützte Formate, Dokumentinformationen |
| Dateien, Ordner und Speicher | Hochladen, Herunterladen, Kopieren, Verschieben, Löschen; Ordner- und Speicheroperationen |
Beispiele ausführen
- Klonen oder laden Sie das Beispiel-Repository herunter
- Bearbeiten Sie
Examples/Utils.php und setzen Sie Ihre ClientId und ClientSecret - Wechseln Sie in das Verzeichnis
Examples - Führen Sie
composer update aus - Führen Sie
php RunExamples.php aus
Für weitere Details besuchen Sie Getting Started.

Document Annotation API | PHP Cloud API | GroupDocs.Annotation Cloud | REST API | Text Field Annotation | Area Annotation | Remove Annotations | Highlight Annotation | Redaction | PDF Annotation | Word Annotation | Supported File Formats | Document Information | Cloud Storage | Secure API Access