Skip to main content
Known Participant
July 21, 2020
Answered

reading PDF from local storage gives 401 error

  • July 21, 2020
  • 1 reply
  • 3933 views

Hello:

I have PDF stored as blobs in local storage (indexed.db). When I read I get a 401 error in console.

 

 

 

var adobeDCView = new AdobeDC.View({ clientId: "xxxx", divId: 'pdf-content' });
adobeDCView.previewFile({
   content: { promise: store.get('test.pdf' },
      metaData: { fileName: "test.pdf" }
   },
   {
     embedMode: "SIZED_CONTAINER"
   });

 

 

 

I get a : ViewSDKInterface.js:1 POST https://viewlicense.adobe.io/viewsdklicense/jwt 401 (Unauthorized) error. I

 

 

 

    This topic has been closed for replies.
    Correct answer Sumona Ghosh

    You have to generate a client ID if you wish to use a web server. You can set the domain as localhost.

    Please try creating credentials from https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html

    Hope this helps.

     

    1 reply

    Adobe Employee
    July 22, 2020

    Thank you for using PDF Embed API. The error seems to indicate that your webpage domain is not authorized to use the client ID configured in the code. Would be great if you could check and confirm if the client ID is used with the correct domain. 

    R.M.RAuthor
    Known Participant
    July 22, 2020

    Unfortunately I have not been able to set the credentials to localhost to test out the new API. And I cannot risk putting it in our production domain. So what would be a suitable solution? Thanks

    Sumona GhoshCorrect answer
    Adobe Employee
    July 22, 2020

    You have to generate a client ID if you wish to use a web server. You can set the domain as localhost.

    Please try creating credentials from https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html

    Hope this helps.