@giga.neeraj
As an update, we have removed GetExport API method in GroupDocs.Annotation Cloud 21.2 release. Now you can annotate PDF in Node.js using GroupDocs.Annotation REST API and use DownloadFile API method to download the file as following.
PDF Markup in Node.js
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node-samples
annotation_cloud = require("groupdocs-annotation-cloud");
var fs = require('fs');
const annotatePDF = async () => {
const appSid = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
const appKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
annotateApi = annotation_cloud.AnnotateApi.fromKeys(appSid, appKey);
fileApi = annotation_cloud.FileApi.fromKeys(appSid, appKey);
let a1 = new annotation_cloud.AnnotationInfo();
a1.annotationPosition = new annotation_cloud.Point();
a1.annotationPosition.x = 1;
a1.annotationPosition.y = 1;
a1.box = new annotation_cloud.Rectangle();
a1.box.x = 100;
a1.box.y = 100;
a1.box.width = 200;
a1.box.height = 100;
a1.pageNumber = 0;
a1.penColor = 1201033;
a1.penStyle = annotation_cloud.AnnotationInfo.PenStyleEnum.Solid;
a1.penWidth = 1;
a1.type = annotation_cloud.AnnotationInfo.TypeEnum.Area;
a1.text = "This is area annotation";
a1.creatorName = "Anonym A.";
let fileInfo = new annotation_cloud.FileInfo();
fileInfo.filePath = "02_pages.pdf";
let options = new annotation_cloud.AnnotateOptions();
options.fileInfo = fileInfo;
options.annotations = [a1];
options.outputPath = "annotateoutput.pdf";
let result = await annotateApi.annotate(new annotation_cloud.AnnotateRequest(options));
//Downlaod PDF document from cloud stroage
const localPath = "C:/Temp/annotateoutput.pdf";
let downloadResult = await fileApi.downloadFile(new annotation_cloud.DownloadFileRequest("annotateoutput.pdf"));
fs.writeFileSync(localPath,downloadResult);
}
annotatePDF()
.then(() => {
console.log("PDF document annotated successfully");
})
.catch((err) => {
console.log("Error occurred while annotated the PDF document:", err);
})