Using PDFs without a PDF suffix

My CMS saves PDFs with a random string added so I get this error message:

The error points to a solution, but I don’t get this to work. So far, I use the script code from the manual implementation section and it works for regular PDFs. But I don’t know if that Core.CreateDocument line code can be placed in there somewhere or if it requires some other context.
Is there a chance to see a complete code snippet for loading a PDF from the same domain that doesn’t have a PDF suffix?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi there,

All what needs to be done is to create the document with createDocument and then load with loadDocument.

const doc = await instance.Core.createDocument('../../static/files/blank.null', { extension: 'pdf' });
instance.Core.documentViewer.loadDocument(doc);

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here