Skip to main content
Tonimo
Participant
Mar 12, 2026 9:45 PM UTC
Question

PDF Embed API issue

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?

    2 replies

    Mar 13, 2026 12:30 AM UTC

    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.

    Translate
    Tonimo
    TonimoAuthor
    Participant
    Mar 13, 2026 2:48 PM UTC

    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

    Translate