You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[/] I have checked sample and test suites to see real life basic implementation
[/] I have checked if this question is not already asked
What are you trying to achieve? Please describe.
I've upgraded from Version 3.0.5 to 4.0.5. After the update my PDF-Files will not be displayed anymore and it keeps "loading".
Describe solutions you've tried
I display my PDF-File as base64-data but tried plain bytes too. Using the provided notification hooks gives me the feedback, that sourcedata is loaded correctly.
Debugging into your code leads me to Document.js and this code:
cancellable = (0, _utils.makeCancellable)(loadingTask.promise);
_this.runningTask = cancellable;
_context.next = 23; // until here is everything fine
return cancellable.promise; // this promise is never resolved
Additional information
I use your lib straight forward:
import { Document, Page } from "react-pdf/dist/entry.webpack";
<Document
file={ isDataBase64 ? `data:application/pdf;base64,${file}` : file }
loading="Das PDF wird geladen..."
onLoadSuccess={ ::this.onDocumentLoadSuccess } // show additional buttons for zoom
className="pdfDocument"
renderMode="svg"
>
<Page
key={ `page_${1}` }
pageNumber={ 1 }
className="pdfPage"
renderMode="svg"
scale={ pageScale } />
</Document>
I've attached a sample PDF for you. Copy+paste it into your browser will work. Using it at the parameter for <Document file={<pdfdata here>}> does not work. samplePDF_base64.txt
It definitely worked for me both pasting it in browser's address field and passing as an URL to file prop in React-PDF! Maybe you're "base64-ing" it twice?
In case it's helpful to anyone else, I also experienced the same never-resolving promise behaviour when I'd accidentally set the url for the worker (pdfjsLib.GlobalWorkerOptions.workerSrc = "....") to point to the main pdf.js file instead of the pdf.worker.js file by mistake.
Before you start - checklist
What are you trying to achieve? Please describe.
I've upgraded from Version 3.0.5 to 4.0.5. After the update my PDF-Files will not be displayed anymore and it keeps "loading".
Describe solutions you've tried
I display my PDF-File as base64-data but tried plain bytes too. Using the provided notification hooks gives me the feedback, that sourcedata is loaded correctly.
Debugging into your code leads me to Document.js and this code:
Additional information
I use your lib straight forward:
I've attached a sample PDF for you. Copy+paste it into your browser will work. Using it at the parameter for
<Document file={<pdfdata here>}>
does not work.samplePDF_base64.txt
Environment
The text was updated successfully, but these errors were encountered: