GroupDocs.Signature Cloud allows to create document preview images, one per page. Image size and format can be set as options.
API usage
There are steps that usage of GroupDocs.Signature Cloud consists of:
Upload input document into cloud storage
Create preview images
Download images
For storage operations, like uploading or downloading documents, please refer to the corresponding articles of this manual.
Swagger UI lets you call this REST API directly from the browser.
cURL example
// First get JSON Web Token
// Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" 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 get document information
curl-v"https://api.groupdocs.cloud/v2.0/signature/preview"\-XPOST\-H"Content-Type: application/json"\-H"Accept: application/json"\-H"Authorization: Bearer <jwt token>"-d"{
'FileInfo': {
'FilePath': 'sample2.pdf'
},
'Format': 'jpg'
}"
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-signature-cloud/groupdocs-signature-cloud-dotnet-samplesstringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudstringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);varapiInstance=newPreviewApi(configuration);// Preview settingsvarpreviewSettings=newPreviewSettings{FileInfo=newFileInfo{FilePath="sample2.pdf",Password=null,VersionId=null,StorageName=Constants.MyStorage,}};varrequest=newPreviewDocumentRequest(previewSettings);varresponse=apiInstance.PreviewDocument(request);Console.WriteLine("Expected response type is PreviewResult: "+response);
// For complete examples and data files, please go to https://github.com/groupdocs-signature-cloud/groupdocs-signature-cloud-java-samples
StringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
StringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);PreviewApiapiInstance=newPreviewApi(configuration);FileInfofileInfo=newFileInfo();fileInfo.setFilePath("Signaturedocs\\one-page.docx");PreviewSettingspreviewSettings=newPreviewSettings();previewSettings.setFileInfo(fileInfo);PreviewDocumentRequestrequest=newPreviewDocumentRequest(previewSettings);PreviewResultresponse=apiInstance.previewDocument(request);System.out.println("Expected response type is PreviewResult: "+response);
// For complete examples and data files, please go to https://github.com/groupdocs-signature-cloud/groupdocs-signature-cloud-php-samples
useGroupDocs\Signature\Model;useGroupDocs\Signature\Model\Requests;$ClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$ClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Signature\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$previewApi=newGroupDocs\Signature\PreviewApi($configuration);$fileInfo=newGroupDocs\Signature\Model\FileInfo();$fileInfo->setFilePath("signaturedocs\one-page.docx");$settings=newGroupDocs\Signature\Model\PreviewSettings();$settings->setFileInfo($fileInfo);$request=newGroupDocs\Signature\Model\Requests\previewDocumentRequest($settings);$response=$previewApi->previewDocument($request);echo"PreviewResult.Pages Count: ".count($response->getPages());echo"\n";
// For complete examples and data files, please go to https://github.com/groupdocs-signature-cloud/groupdocs-signature-cloud-node-samples
global.signature_cloud=require("groupdocs-signature-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.previewApi=signature_cloud.PreviewApi.fromKeys(clientId,clientSecret);letfileInfo=newsignature_cloud.FileInfo();fileInfo.filePath="signaturedocs/one-page.docx";letsettings=newsignature_cloud.PreviewSettings();settings.fileInfo=fileInfo;letrequest=newsignature_cloud.PreviewDocumentRequest(settings);letresponse=awaitpreviewApi.previewDocument(request);console.log("GetDocumentPreview: PagesCount = "+response.pages.length);
# For complete examples and data files, please go to https://github.com/groupdocs-signature_cloud-cloud/groupdocs-signature_cloud-cloud-python-samplesfromgroupdocs_signature_cloudimport*importgroupdocs_signature_cloudclient_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudapi=groupdocs_signature_cloud.PreviewApi.from_keys(client_id,client_secret)fileInfo=FileInfo()fileInfo.file_path="signaturedocs\\one-page.docx"fileInfo.password=NonefileInfo.version_id=NonefileInfo.storage_name=Common.myStoragesettings=PreviewSettings()settings.file_info=fileInforequest=PreviewDocumentRequest(settings)response=api.preview_document(request)print("Page count = "+str(len(response.pages)))
# For complete examples and data files, please go to https://github.com/groupdocs-signature-cloud/groupdocs-signature-cloud-ruby-samplesrequire'groupdocs_signature_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudapi=GroupDocsSignatureCloud::PreviewApi.from_keys($client_id,$client_secret)$settings=GroupDocsSignatureCloud::PreviewSettings.new()$info=GroupDocsSignatureCloud::FileInfo.new()$info.file_path="signaturedocs\\one-page.docx"$info.password=nil$settings.file_info=$info$request=GroupDocsSignatureCloud::PreviewDocumentRequest.new($settings)# Executing an API.$response=api.preview_document($request)puts("Pages count: "+$response.pages.length.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.