GetPages method allows to create an image representation of each page of the document.
API usage
There are steps that usage of GroupDocs.Annotation Cloud consists of:
Upload input document into cloud storage and other files, like image annotation
Add annotation
Call Preview method
Download result pages from cloud storage
HTTP POST ~/annotation/preview/create
Swagger UI lets you call this REST API directly from the browser.
cURL example
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl-v"https://api.groupdocs.cloud/connect/token"\-XPOST\-d"grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\-H"Content-Type: application/x-www-form-urlencoded"\-H"Accept: application/json"// cURL example to create document preview images
curl-v"https://api.groupdocs.cloud/v2.0/annotation/preview/create"\-XPOST\-H"Content-Type: application/json"\-H"Accept: application/json"\-H"Authorization: Bearer <jwt token>"\-d"{ \"FileInfo\": { \"FilePath\": \"one-page.docx\" }}"
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-dotnet-samplesstringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudstringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyAppSid,MyAppKey);varapiInstance=newAnnotateApi(configuration);varfileInfo=newFileInfo{FilePath="one-page.docx"};varoptions=newPreviewOptions{FileInfo=fileInfo};varrequest=newGetPagesRequest(options);varresponse=apiInstance.GetPages(request);Console.WriteLine("GetPages: pages count = "+response.TotalCount);
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-java-samples
StringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
StringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyAppSid,MyAppKey);AnnotateApiapiInstance=newAnnotateApi(configuration);// Create request object.
FileInfofileInfo=newFileInfo();fileInfo.setFilePath("Annotationdocs\\one-page.docx");PreviewOptionsoptions=newPreviewOptions();options.setFileInfo(fileInfo);GetPagesRequestrequest=newGetPagesRequest(options);// Executing api method.
PageImagesresponse=apiInstance.getPages(request);System.out.println("GetPages: pages count = "+response.getTotalCount());
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php-samples
useGroupDocs\Annotation\Model;useGroupDocs\Annotation\Model\Requests;$AppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Annotation\Configuration();$configuration->setAppSid($AppSid);$configuration->setAppKey($AppKey);$apiInstance=newGroupDocs\Annotation\AnnotateApi($configuration);$fileInfo=newGroupDocs\Annotation\Model\FileInfo();$fileInfo->setFilePath("annotationdocs\\one-page.docx");$options=newGroupDocs\Annotation\Model\PreviewOptions();$options->setFileInfo($fileInfo);$request=newGroupDocs\Annotation\Model\Requests\GetPagesRequest($options);$response=$apiInstance->getPages($request);echo"GetPages: pages count = ",$response->getTotalCount();
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node-samples
global.annotation_cloud=require("groupdocs-annotation-cloud");global.appSid="XXXX-XXXX-XXXX-XXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.appKey="XXXXXXXXXXXXXXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.annotateApi=annotation_cloud.AnnotateApi.fromKeys(appSid,appKey);letfileInfo=newannotation_cloud.FileInfo();fileInfo.filePath="annotationdocs\\one-page.docx";letoptions=newannotation_cloud.PreviewOptions();options.fileInfo=fileInfo;constresponse=awaitpreviewApi.getPages(newannotation_cloud.GetPagesRequest(options));console.log("GetPages: pages count = "+response.totalCount);
# For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-python-samplesimportgroupdocs_annotation_cloudapp_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapp_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapi=groupdocs_annotation_cloud.AnnotateApi.from_keys(app_sid,app_key)file_info=FileInfo()file_info.file_path="annotationdocs\\one-page.docx"options=PreviewOptions()options.file_info=file_inforequest=GetPagesRequest(options)response=api.get_pages(request)print("GetPages: pages count = "+str(response.total_count))
# For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-ruby-samplesrequire'groupdocs_annotation_cloud'$app_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$app_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$api=GroupDocsAnnotationCloud::AnnotateApi.from_keys($app_sid,$app_key)file_info=GroupDocsAnnotationCloud::FileInfo.new()file_info.file_path="annotationdocs\\one-page.docx"options=GroupDocsAnnotationCloud::PreviewOptions.new()options.file_info=file_inforequest=GroupDocsAnnotationCloud::GetPagesRequest.new(options)response=$api.get_pages(request)puts("GetPages: pages count = "+(response.total_count).to_s)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.