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.


Docs Swagger Examples Blog Support Release Notes Dashboard

Installation

The package is available at Packagist and it can be installed via Composer by executing following command:

composer require groupdocscloud/groupdocs-annotation-cloud

Packagist Version Packagist Downloads PHP-GroupDocsCloud


Cloud Document Annotation PHP SDK

GroupDocs.Annotation Cloud API provides a comprehensive PHP SDK for seamless document annotation in the cloud. Add, edit, and manage annotations within popular file formats like PDF, Word, and Excel, with features like text highlighting, redaction, and collaborative commenting.


Document Annotations

Text Annotations

Add comments or explanations directly within the text.

Area Annotations

Highlight specific areas in a document for more detailed notes.

Point Annotations

Mark points of interest in a document for easy reference.

Arrow Annotations

Direct attention to specific document elements using arrows.

Strikeout/Underline Annotations

Highlight text by striking through or underlining it.

Markup Features

Highlighting

Mark key sections of the text with highlights for emphasis.

Redaction

Hide or censor sensitive information within a document completely.

Watermarking

Add watermarks to documents to indicate ownership or status.

Annotation Management

Edit Annotations

Modify existing annotations in a document.

Delete Annotations

Remove outdated or unnecessary annotations.

Export Annotations

Extract annotations to store separately or share.

Collaboration Features

Commenting

Facilitate multi-user collaboration with threaded commenting.

Version Control

Track changes to annotations with built-in versioning.

Real-Time Updates

Keep all users in sync with real-time annotation updates during collaboration.

Security Features

Access Control

Protect document annotations with user-based access control.

Role-Based Permissions

Assign different permission levels for added security over annotations.

Encryption

Secure document data during transfer and storage with encryption.

Advanced Features

Combine Annotations

Merge multiple annotations into a single document.

Layered Annotations

Add and manage layered annotations for more flexibility in redacting and marking documents.

Custom Annotation Styles

Customize the appearance of annotations with different colors, opacity, and sizes.

API Integration

Easily integrate annotation features into other systems using REST APIs.

Scalable Infrastructure

The SDK supports scalable architecture, making it suitable for high-load environments.


Supported Annotation Types

Area Annotation

  • Mark specific areas of a document with customizable rectangles.
  • Supports comments and replies for collaborative reviews.

Distance Annotation

Measure the distance between objects in a document, especially useful for technical documents.

Ellipse Annotation

Highlight circular or elliptical areas with customizable properties like radius, color, and opacity.

Image Annotation

Insert images into a document for visual references like logos or stamps.

Add hyperlinks to specific text or areas, providing navigation or referencing additional resources.

Multiple Annotation

Add various types of annotations (e.g., text, shapes, images) simultaneously within a document.

Point Annotation

Attach comments to specific points within the document, ideal for collaborative feedback.

Polyline Annotation

Draw connected lines to create shapes or mark paths in a document, with options for customizing line thickness and color.

Resource Redaction Annotation

Hide sensitive information by adding black rectangles over content, commonly used in legal or financial documents.

Squiggly Annotation

Highlight text with a squiggly underline, often used for marking spelling or grammar issues.


By using GroupDocs.Annotation Cloud SDK for PHP, developers can efficiently manage document annotations in a wide variety of formats, enabling powerful collaboration, security, and customization options. This SDK simplifies the annotation process, allowing PHP developers to focus on building and enhancing their applications.

Supported Annotation Formats

File FormatDescriptionAnnotate
DOC, DOCXWord® Document✔️
OTTOpen Document Standard Format✔️
ODTOpen Document Text File Format✔️
DOCMMicrosoft Word® Open XML Macro-Enabled Document✔️
DOTWord® Document Template File✔️
DOTXWord® Open XML Document Template✔️
DOTMWord® Open XML Macro-Enabled Template File✔️
RTFRich Text File Format✔️
TXTPlain Text File Format✔️
PDFPortable Document Format✔️
PPT, PPTXPresentation Document Format✔️
PPSXPowerPoint Open XML Slide Show✔️
ODPOpenDocument Presentation File Format✔️
OTPOpenDocument Presentation Template✔️
XLS, XLSXCells Document Format✔️
XLSBMicrosoft Excel® Binary Spreadsheet File✔️
XLSXMicrosoft Excel® Open XML Spreadsheet✔️
DICOMDigital Imaging and Communication in Medicine✔️
DJVUDjVu Format✔️
EMF/WMFEnhanced MetaFile / Windows MetaFile✔️
CADComputer-Aided Design✔️
EML/EMLXEmail Markup Language✔️
HTMLHypertext Markup Language✔️
MHTMLMIME HTML File✔️
JPEGJoint Photographic Experts Group✔️
TIFFTagged Image File Format✔️
BMPBitmap✔️
GIF (static images without animation)Graphics Interchange Format✔️
VSDMicrosoft Visio® Drawing✔️
VDXMicrosoft Visio® XML File Format✔️
VSSMicrosoft Visio® Stencil File Format✔️
VSDMMicrosoft Visio® Macro-Enabled Drawing File✔️
MSGEmail Message✔️

Getting Started with GroupDocs.Annotation Cloud

Create an Account

  • Visit the Dashboard and register for a free account.

Create an API Client App

  • Generate your Client ID and Client Secret from the Dashboard to authenticate API requests.

Dependencies

  • PHP 5.5 or later

Installation & Usage

Composer

The package is available at Packagist and it can be installed via Composer by executing following command:

composer require groupdocscloud/groupdocs-annotation-cloud

Or you can install SDK via Composer directly from this repository, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php.git"
    }
  ],
  "require": {
    "groupdocscloud/groupdocs-annotation-cloud": "*"
  }
}

Then run composer install.

Manual Installation

Clone or download this repository, then run composer install in the root directory to install dependencies and include autoload.php into your code file:

require_once('/path/to/groupdocs-annotation-cloud-php/vendor/autoload.php');

Tests

To run the unit tests set your AppSID and AppKey in json.config and execute following commands:

php composer.phar install
./vendor/bin/phpunit

Run the PHP Example

Please follow the installation procedure and then run the following:

<?php

require_once(__DIR__ . '/vendor/autoload.php');

//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
$configuration->setAppKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

$infoApi = new GroupDocs\Annotation\InfoApi($configuration); 

try {
    $response = $infoApi->getSupportedFileFormats();

    foreach ($response->getFormats() as $key => $format) {
        echo $format->getFileFormat() . " - " .  $format->getExtension(), "\n";
    }
} catch (Exception $e) {
    echo  "Something went wrong: ",  $e->getMessage(), "\n";
    PHP_EOL;
}

?>

GroupDocs.Annotation Cloud API Data Models

FilesUploadResult, Error, ErrorDetails, FilesList, StorageFile, StorageExist, ObjectExist, DiscUsage, FileVersions, FileVersion, AnnotationInfo, Rectangle, Point, AnnotationReplyInfo, FileInfo, AnnotationApiLink, Link, RemoveOptions, AnnotateOptions, FormatsResult, Format, DocumentInfo, PageInfo, ConsumptionResult, PageImages, PageImage, LinkElement, PreviewOptions

PHP Code Sample 1: Add Text Annotation

This code sample demonstrates how to add a text annotation to a document using GroupDocs.Annotation Cloud SDK for PHP. The text annotation is customizable in terms of position, font, and color.

// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php-samples
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
 
$AppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid($AppSid);
$configuration->setAppKey($AppKey);
 
$apiInstance = new GroupDocs\Annotation\AnnotateApi($configuration);
 
$a = new GroupDocs\Annotation\Model\AnnotationInfo();
$pt = new GroupDocs\Annotation\Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new GroupDocs\Annotation\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(GroupDocs\Annotation\Model\AnnotationInfo::TYPE_TEXT_FIELD);
$a->setText("Text field text");
$a->setCreatorName("Anonym A.");   
 
$fileInfo = new GroupDocs\Annotation\Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
 
$options = new GroupDocs\Annotation\Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
 
$request = new GroupDocs\Annotation\Model\Requests\annotateRequest($options);
$result = $apiInstance->annotate($request);
 
echo "AddTextFieldAnnotation: Text Field Annotation added: " . $result->getHref();

PHP Code Sample 2: Add Area Annotation

This code sample demonstrates how to add an area annotation.

// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php-samples
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
 
$AppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid($AppSid);
$configuration->setAppKey($AppKey);
 
$apiInstance = new GroupDocs\Annotation\AnnotateApi($configuration);
 
$a = new GroupDocs\Annotation\Model\AnnotationInfo();
$pt = new GroupDocs\Annotation\Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new GroupDocs\Annotation\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(GroupDocs\Annotation\Model\AnnotationInfo::PEN_STYLE_SOLID);
$a->setPenWidth(1);
$a->setOpacity(0.7);
$a->setType(GroupDocs\Annotation\Model\AnnotationInfo::TYPE_AREA);
$a->setText("This is area annotation");
$a->setCreatorName("Anonym A.");   
 
$fileInfo = new GroupDocs\Annotation\Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
 
$options = new GroupDocs\Annotation\Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
 
$request = new GroupDocs\Annotation\Model\Requests\annotateRequest($options);
$result = $apiInstance->annotate($request);
 
echo "AddAreaAnnotation: Area Annotation added: " . $result->getHref();

PHP Code Sample 3: Remove Annotation

This code sample demonstrates how to remove an annotation from a document.

// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php-samples
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
 
$AppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid($AppSid);
$configuration->setAppKey($AppKey);
 
$apiInstance = new GroupDocs\Annotation\AnnotateApi($configuration);
 
$fileInfo = new GroupDocs\Annotation\Model\FileInfo();
$fileInfo->setFilePath("input\\input.docx");
 
$options = new GroupDocs\Annotation\Model\RemoveOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotationIds([1, 2, 3]);
$options->setOutputPath("Output\\output.docx");
 
$request = new GroupDocs\Annotation\Model\Requests\removeAnnotationsRequest($options);
$result = $apiInstance->removeAnnotations($request);
 
echo "DeleteAnnotations: Annotations deleted. " . $result->getHref();

Docs Swagger Examples Blog Support Release Notes Dashboard


 English