Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

APIs not allowed on this PDF

Explorer ,
Feb 26, 2023 Feb 26, 2023

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

TOPICS
PDF Embed API
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 02, 2023 Mar 02, 2023

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

Translate
Explorer ,
Feb 26, 2023 Feb 26, 2023
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 27, 2023 Feb 27, 2023

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2023 Mar 02, 2023

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 02, 2023 Mar 02, 2023
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources