Skip to main content
Known Participant
Feb 26, 2023 5:14 PM UTC
Answered

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

This topic is closed to new replies. Start a new post to keep the conversation going.
Raymond Camden
Raymond CamdenCorrect answer
Community Manager
Mar 2, 2023 3:29 PM UTC

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. 


Yes, as expected. If our Embed library blissfully ignored security that would be a bad thng. 😉

4 replies

tangyunAuthor
Known Participant
Feb 26, 2023 5:15 PM UTC
Cost-benefit_analysis_and_large-scale_infrastructure_projects.pdf
Translate
Raymond Camden
Community Manager
Community Manager
Feb 27, 2023 7:53 PM UTC

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. 

Translate
tangyunAuthor
Known Participant
Mar 2, 2023 9:42 AM UTC

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. 

Translate