APIs not allowed on this PDF
I'm trying to render the PDF and extract all the annotations (if available) of the following PDF file.
https://drive.google.com/file/d/1PiEcI0bcviYecwbzwVCs2rY_0tiqfj2F/view?usp=share_link
with the following code snippet:
try {
await viewSDKClient.ready();
const filePromise = Promise.resolve(file.arrayBuffer);
// Pass the filePromise and name of the file to the previewFile API
const adobeViewerPromise = viewSDKClient.previewFileUsingFilePromise(
`pdf-div-${file.name}`, filePromise, file.name, UploadSizedContainerConfig);
const adobeViewer = await adobeViewerPromise;
const annotationManager = await adobeViewer.getAnnotationManager();
const res = await annotationManager.removeAnnotationsFromPDF();
return Promise.resolve({
pdfBuffer: res["pdfBuffer"],
annotations: res["annotations"]
});
} catch (err) {
console.error(err);
return Promise.resolve({});
} finally {
...
}
And I keep getting this error:
{code: 'FAIL', message: 'APIs not allowed on this PDF.'}
Please help. thanks
