I'm trying the load a pdf from a URL but I get a warning:
"[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/."
Also, when I save the PDF it is empty so I guess the pdf file was not loaded into jsPDF.
Does anyone know how this can be done?
This is the code that I've used:
add<script>
url = 'https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf';
function loadPdf() {
myPdf = new jsPDF();
myPdf.loadFile(url, false, responsePDF());
}
function responsePDF() {
console.log("in callback")
myPdf.save("pdfjs.pdf");
}
</script>