Skip to main content
Known Participant
September 2, 2021
Question

pdf embed API- invalid content error

  • September 2, 2021
  • 1 reply
  • 1139 views

Hi,

This happens to me when i try to reach my viewer page in another way. the standard way with the same file works and i can't seem to find the problem. BTW, no cleanup is needed because it's the first viewed pdf.

Uncaught Error: Invalid content information is provided.
at ValidationService._validateFileInfoContent (VM11047 ViewSDKInterface.js:1)
at ValidationService.validateFileInfo (VM11047 ViewSDKInterface.js:1)
at EmbedModeHandlerService._getFinalFileInfo (VM11047 ViewSDKInterface.js:1)
at EmbedModeHandlerService.initialiseAction (VM11047 ViewSDKInterface.js:1)
at ViewSDKInterfaceApp.previewFile (VM11047 ViewSDKInterface.js:1)
at View.previewFile (VM11047 ViewSDKInterface.js:1)
at index.b84afd08cc2cf893a2ff.js?v=2:2
at HTMLDocument.<anonymous> (index.b84afd08cc2cf893a2ff.js?v=2:2)
at Module.Vu6y (VM11047 ViewSDKInterface.js:1)
at __webpack_require__ (VM11047 ViewSDKInterface.js:1)
    This topic has been closed for replies.

    1 reply

    Known Participant
    October 13, 2021

    I have the same error when I call the API like this:

    this.adobeDCView = new window.AdobeDC.View(config);
    /* Invoke the file preview API on Adobe DC View object */
    this.adobeDCView.previewFile({
    /* Pass information on how to access the file */
    content: {
    /* Location of file where it is hosted */
    location: {
    promise: Promise.resolve(buffer) // pdf file,
    ...
    the buffer is an ArrayBuffer for the PDF file.
    We used to use the PSPDFKit to view the PDF, like this:
    PSPDFKit.load({
    	document: myDocumentArrayBuffer
    });
    It works OK on PSPDFKit, but the same document arrayBuffer doesn't work when passed to adobeDCView.
    Any ideas?
     

     

    Alon5FCDAuthor
    Known Participant
    October 14, 2021

    For me, it was a timing problem.

    Creating the viewer involve some asynchronous calls. I transformed some of them to async await instead of good old promises and it solved my problem but i think that your problem is a bit different.