Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF.js pages does not get painted. Only white pages are displayed
    primarykey
    data
    text
    <p>I am trying to render a pdf in chrome using PDFJS</p> <p><strong>This is the function I am calling:</strong></p> <pre><code>open: function pdfViewOpen(url, scale, password) { var parameters = {password: password}; if (typeof url === 'string') { // URL this.setTitleUsingUrl(url); parameters.url = url; } else if (url &amp;&amp; 'byteLength' in url) { // ArrayBuffer parameters.data = url; } if (!PDFView.loadingBar) { PDFView.loadingBar = new ProgressBar('#loadingBar', {}); } this.pdfDocument = null; var self = this; self.loading = true; getDocument(parameters).then( function getDocumentCallback(pdfDocument) { self.load(pdfDocument, scale); self.loading = false; }, function getDocumentError(message, exception) { if (exception &amp;&amp; exception.name === 'PasswordException') { if (exception.code === 'needpassword') { var promptString = mozL10n.get('request_password', null, 'PDF is protected by a password:'); password = prompt(promptString); if (password &amp;&amp; password.length &gt; 0) { return PDFView.open(url, scale, password); } } } var loadingErrorMessage = mozL10n.get('loading_error', null, 'An error occurred while loading the PDF.'); if (exception &amp;&amp; exception.name === 'InvalidPDFException') { // change error message also for other builds var loadingErrorMessage = mozL10n.get('invalid_file_error', null, 'Invalid or corrupted PDF file.'); //#if B2G // window.alert(loadingErrorMessage); // return window.close(); //#endif } var loadingIndicator = document.getElementById('loading'); loadingIndicator.textContent = mozL10n.get('loading_error_indicator', null, 'Error'); var moreInfo = { message: message }; self.error(loadingErrorMessage, moreInfo); self.loading = false; }, function getDocumentProgress(progressData) { self.progress(progressData.loaded / progressData.total); } ); } </code></pre> <p><strong>This is the call:</strong></p> <pre><code>PDFView.open('/MyPDFs/Pdf2.pdf', 'auto', null); </code></pre> <p><strong>All I get is this:</strong></p> <p><img src="https://i.stack.imgur.com/MXb8p.png" alt=""></p> <p>If you notice, even the page number is retrieved but the content is not painted in the pages. Can´t find why.. Is the any other function I should call next to PDFView.open?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload