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
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [x] Feature request
- [x] Documentation issue or request
Based on some network issues, I have added pdfjs-dist to my package.json. Then I found I can set custom path to the worker... Can I use the bundled pdfjs-dist instead of downloading one?
Thank you for reply!
The text was updated successfully, but these errors were encountered:
I'm making a mobile app that can view pdfs offline using the <pdf-viewer> element. I needed to customize the worker path due to cloudflare not being listed in our <meta> content security policy or available offline, but did need to add the following, http: for localhost development, file: for cordova android/ios and electron mac/win/linux.
worker-src http: file:;
Similar to ng2-pdf-viewer itself, my app is also using webpack.
In the client before the component containing the <pdf-viewer> element is constructed:
declare let window: any;
window.pdfWorkerSrc = require('pdfjs-dist/webpack');
I no longer get the error Warning: Setting up fake worker. pdf.js 351 and my own animated loading spinner on the page no longer noticeably freezes/is choppy during the pdf's rendering, indicating that pdf rendering is no longer processing on the UI-thread, but instead on the worker-thread.
I found this solution for webpack users of pdfjs-dist in issue 7612, here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report or Feature Request (mark with an
x
)Based on some network issues, I have added pdfjs-dist to my package.json. Then I found I can set custom path to the worker... Can I use the bundled pdfjs-dist instead of downloading one?
Thank you for reply!
The text was updated successfully, but these errors were encountered: