Recently we have shared that we are working on Next Generation GroupDocs Cloud APIs. Our product team works hard to improve your development experience with reliable and accurate solutions. So we are very much excited to announce first public release of Next Generation GroupDocs.Viewer Cloud REST API 17.11
The Groupdocs.Viewer Cloud REST API) offers a suite of useful and powerful features those enable developers to display over 50 document formats in their web/mobile apps or website in Cloud.
GroupDocs.Viewer CloudGroupDocs.Viewer
Cloud API gives developers an API to render over 50 documents and image formats as HTML or image format for whole document, page-by-page or custom range of pages. The viewer can both rasterize documents and convert them to SVG+HTML+CSS, delivering true-text high-fidelity rendering. Rotating, Reordering and Watermarking document pages are other important features of this REST API. For complete details of features offered by Next Generation GroupDocs.Viewer Cloud REST API, please check release notes for first version. Following section shares some details about these features.
Get Attachment for HTML Representation
You can get attachment data of an Email for HTML or Image representation. Please see the following URI and REST command(Curl) for the purpose.
URI
[https://api.groupdocs.cloud/v1/viewer/{filename}/html/attachments/{attachmentfilename}][3]
Rest example(cURL)
curl -v "[https://api.groupdocs.cloud/v1/viewer/Test.msg/html/attachments/Test.pdf"][4] \
-X GET \
-H "Content-Type: application/json" \
-H "authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
```.NET SDK example
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
var configuration = new Configuration
{
AppSid = Sid,
AppKey = Key
};
var apiInstance = new ViewerApi(configuration);
try
{
var request = new HtmlGetAttachmentRequest
{
FileName = "with-attachment.msg",
AttachmentName = "password-protected.docx",
Folder = null,
Storage = null
};
var response = apiInstance.HtmlGetAttachment(request);
Debug.Print("Document processed successfully");
}
catch (Exception e)
{
Debug.Print("Exception when getting attachments from Email: " + e.Message);
}
Watermark a Document for HTML Representation
You can easily watermark and download a document as PDF with GroupDocs.Viewer Cloud API. The API expects PdfFileOptions object data in request body. Please see the following URI, JSON Request data, REST command(Curl) and .NET SDK example for the purpose. URI
[https://api.groupdocs.cloud/v1/viewer/{filename}/html/pdf][5]
Request Data
{"watermark":{"text":"My Company"}}
Rest example(cURL)
curl -v "[https://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pdf"][6] \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{"watermark":{"text":"My Company"}}" \
-H "authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
.NET SDK example
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
var configuration = new Configuration
{
AppSid = Sid,
AppKey = Key
};
var apiInstance = new ViewerApi(configuration);
try
{
var pdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions
{
Watermark = new GroupDocs.Viewer.Cloud.Sdk.Model.Watermark { Text = "Test" }
};
var request = new ImageCreatePdfFileRequest
{
FileName = "one-page.docx",
PdfFileOptions = pdfFileOptions,
FontsFolder = null,
Folder = null,
Storage = null,
};
var response = apiInstance.ImageCreatePdfFile(request);
Debug.Print("Document Processed");
Debug.Print(response.FileName);
Debug.Print(response.Folder);
Debug.Print(response.PdfFileName);
}
catch (Exception e)
{
Debug.Print("Exception when processing document: " + e.Message);
}
GroupDocs.Viewer Cloud Resources
Following are the links to some useful resources you may need to accomplish your tasks.
- GroupDocs.Viewer Cloud
- GroupDocs.Viewer Cloud Online Documentation
- GroupDocs.Viewer Cloud UI Help Topics
- GroupDocs.Viewer Cloud Forum
- Web API Explorer(Live Examples)
- GroupDocs.Viewer Cloud SDKs
- Work with GroupDocs Cloud Storage using Web GUI
- Work with GroupDocs Usage and Logs using Web GUI
Start a Free Trial Today
Start a free trial today – all you need is to sign up with the GroupDocs Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by GroupDocs Cloud.