Skip to main content
Tonimo
Participant
March 12, 2026
Question

PDF Embed API issue

  • March 12, 2026
  • 1 reply
  • 85 views

Hi All,

We started getting the following error recently:

DataCloneError: Failed to execute 'postMessage' on 'Window': #<Promise> could not be cloned.

when calling the getPDFMetadata() method.

Here’s the code:

previewFilePromise.then((adobeViewer) => {
adobeViewer.getAPIs().then((apis) => {
// All viewer APIs can be invoked here
apis.getPDFMetadata().then((result) => {
numPages = result.numPages;
pdfTitle = result.pdfTitle;
});
.catch((error) => console.log(error));
});
});

The pdf displays correctly in the viewer however the getMetadata() method fails and we can’t get the number of pages, … 

Is anyone having this issue?

    1 reply

    Joel  Geraci
    Adobe Employee
    Adobe Employee
    March 13, 2026

    Avoid getting the metadata just after the viewer instantiates; the PDF may not be completely loaded.

    Instead, listen for PDF_VIEWER_READY which triggers when the PDF is rendered completely and the PDF viewer is ready to perform functionalities, such as annotations, form-filling, and getting the number of pages. This event is especially useful in the case of linearized PDFs to check when the PDF gets fully downloaded.

    Tonimo
    TonimoAuthor
    Participant
    March 13, 2026

    Hi Joel,
    Thanks for your feedback. Even when using the PDF_VIEWER_READY event, the getPDFMetadata() throws the same error. The issue started happening on March 9, 2026. Has there been any updates around that day that may have caused this?

    Thanks