Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use alternative source for PDF.js loading #1610

Closed
wants to merge 6 commits into from

Conversation

MacDeveloper1
Copy link
Contributor

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 and pdf.worker.min.js.

<script>
  var dartPdfJsBaseUrl = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/";
</script>

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.

<script>
  var dartPdfJsBaseUrl = "assets/js/pdf/";
</script>

@DavBfr
Copy link
Owner

DavBfr commented Feb 21, 2024

Merged, thanks.

@DavBfr DavBfr closed this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants