How do I set up the core for Advanced customization?

Detailed description of issue
I want to do some advanced customization using git source (https://github.com/PDFTron/webviewer-ui).
How do I set up the core?

Is it right to use Core of https://www.npmjs.com/package/@pdftron/pdfjs-express?

This setting will cause an error.

CoreControls.js:515 GET http://localhost:3000/core/pdf/simple_wasm/MemGrow.js net::ERR_ABORTED 404 (Not found)

The version is v7.0.0.

The same result is obtained even if core is set in another way.

$npx @pdftron/webviewer-downloader --core-only --path ./lib
It is the same result even if I receive it as follows and build it in the latest master branch after setting the core and test it.

:3000/core/pdf/simple_wasm/MemGrow.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

Hi there,

There is some additional configuration that needs to be done to make the UI work with the PDF.js Express Core. We are going to spend some time figuring out how to make this easier for everyone, and then get back to you with an easier solution!

For now, you have to replace the index.html file in the UI to this:

<!doctype html>
<html moznomarginboxes mozdisallowselectionprint>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="icon" href="assets/pdftron.ico">
    <link rel="stylesheet" href="./style.css">
    <title>WebViewer UI</title>
  </head>
  <body>
    <div id="app"></div>
    <div id="portal"></div>
    <script src="../core/CoreControls.js"></script>
    <script src="../core/pdfjs/PDFJSDocumentType.js"></script>
    <script src="../core/pdfjs/UIConfig.js"></script>
    <script src="webviewer-ui.min.js"></script>
  </body>
</html>

If this doesn’t work please let me know.

Thank you!
Logan

1 Like