PDF.js Express Version
Probably 7.3.3. I’m not sure, because I cannot initialize viewer so I don’t get this info in console.
Detailed description of issue
I get “Failed to load resource: the server responded with a status of 404” when I run my application.
I assume that there’s some problems with accessing index.html with viewer.
Full error message:
Failed to load resource: the server responded with a status of 404 (Not Found)
~/lib/pdfexpress/lib/ui/index.html#d=https%3A%2F%2Fwww.w3.org%2FWAI%2FER%2Ftests%2Fxhtml%2Ftestfiles%2Fresources%2Fpdf%2Fdummy.pdf&a=1&filepicker=0&pdfnet=0&enableRedaction=0&enableMeasurement=0&pageHistory=1¬esInLeftPanel=0&singleServerMode=false&selectAnnotationOnCreation=0&id=1:
Expected behaviour
Properly rendered viewer
Does your issue happen with every document, or just one?
I tried document from url, and a few documents from my local files. Problem is the same for both cases.
Link to document
{Provide a link to the document in question if possible}
Code snippet
Code which i use to initialize viewer:
<script src="~/lib/pdfexpress/lib/webviewer.min.js"></script>
<div id="express_viewer"></div>
<script>
const viewer = document.getElementById("express_viewer");
WebViewer({
path: '~/lib/pdfexpress/lib',
licenseKey: 'my license code here',
initialDoc: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
}, viewer).then(instance => {
onReady();
const { docViewer } = instance;
docViewer.on('documentLoaded', onDocumentLoaded);
});
// Vanilla JS
const onReady = instance => {
// Executed when the viewer is ready
// NOTE: Document is not loaded yet
instance.enableFilePicker();
};
</script>