Allow to use alternative source for PDF.js loading #1610
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In noticed that the predefined CDN for PDF printing (https://unpkg.com/pdfjs-dist) is often returns the 502 error. So that inspire me to add functionality when user can change the CDN or even use local copy of pdf.js.
To change the CDN base URL user have to created a JavaScript variable and initialize it with the directory which contains files
pdf.min.js
andpdf.worker.min.js
.To use local storage for PDF scripts, save the required files into the new directory insside the root directory of site and initialize the variable.