PDF.js Express Version
7.2.2
Detailed description of issue
My project is built using Gatsby and I was following the getting started guide for React. (gatsby uses react) I made sure to copy all the files to the static/public folder. However when I initialize the page, it throws a 404 error inside the div where the webviewer ref is.
’ There’s not a page yet at /webviewer/lib/ui/index.html
’
Expected behaviour
Does your issue happen with every document, or just one?
Every document
Link to document
Code snippet
import React, { useEffect, useRef } from ‘react’
import Layout from ‘components/Layout’
import WebViewer from ‘@pdftron/pdfjs-express’
const Test = () => {
const viewer = useRef(null)
useEffect(() => {
WebViewer(
{
path: '/webviewer/lib',
initialDoc: 'https://assets.ctfassets.net/xo7k5gkhtsb4/6BVRpmOL6sKkjXKHZj2MXQ/4d3825f979999fd81f5fd6ee937df5f6/Job-Embedded-PD-2015.pdf'
},
viewer.current
).then((instance) => {
})
}, [])
return (
<Layout>
<div className="h-screen">
<p>TEST PDF</p>
<div className="webviewer" ref={viewer}></div>
</div>
</Layout>
)
}
export default Test