Copy link to clipboard
Copied
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
Yes, as expected. If our Embed library blissfully ignored security that would be a bad thng. 😉
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Looking at permissions, it says that changing the document is not allowed. This would stop you from removing annotations I'd imagine as that's a change.
Copy link to clipboard
Copied
I see. thank you for the reply and clarification. Does it mean that unless I find a way to remove all the security restrictions either with password or by some sort of third-party tools, I will not be able to do anything with the PDF right? thanks.
Copy link to clipboard
Copied
Yes, as expected. If our Embed library blissfully ignored security that would be a bad thng. 😉