Initialize PDF.js in website
<p>I am trying to integrate <code>PDF.js</code> in my website, but am unable to get it done correctly.</p>

<p>This is what the screen shows:</p>

<p><a href="https://i.stack.imgur.com/aixrP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aixrP.png" alt="enter image description here"></a></p>

<p>I can not see the PDF file on the screen, but when I press <code>Print</code>, the print menu does show the PDF file in it. Other functionality is working fine. </p>

<p>This is my code:</p>

<pre><code>[[HTML HERE downloaded from source of PDF.JS]]

&lt;!-- This snippet is used in production (included from viewer.html) --&gt;
&lt;link rel="resource" type="application/l10n" href="&lt;?php echo JS_LIB_FOLDER; ?&gt;pdfjs/web/locale/locale.properties"/&gt;

&lt;?php
echo $this-&gt;Html-&gt;css(JS_LIB_FOLDER . 'pdfjs/web/viewer.css');

echo $this-&gt;Html-&gt;script(JS_LIB_FOLDER . 'pdfjs/web/compatibility.js');
echo $this-&gt;Html-&gt;script(JS_LIB_FOLDER . 'pdfjs/web/l10n.js');
echo $this-&gt;Html-&gt;script(JS_LIB_FOLDER . 'pdfjs/build/pdf.js');
echo $this-&gt;Html-&gt;script(JS_LIB_FOLDER . 'pdfjs/web/debugger.js');
echo $this-&gt;Html-&gt;script(JS_LIB_FOLDER . 'pdfjs/web/viewer.js');
?&gt;

&lt;script type="text/javascript"&gt;
    'use strict';
    PDFJS.imageResourcesPath = site_url+'js/library/pdfjs/web/images/';
    PDFJS.workerSrc = site_url+'js/library/pdfjs/build/pdf.worker.js';
    PDFJS.cMapUrl = site_url+'js/library/pdfjs/web/cmaps/';

&lt;/script&gt;
</code></pre>

<p>I have googled this issue extensively, but found nothing on how to successfully integrate this library. Any penny help will be appreciated.</p>

<p><strong>P.S.</strong> There is no error in javascript console.</p>