How to use 'download pdf javascript' in JavaScript

Every line of 'download pdf javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
41_downloadPDF() {
42 const pageTitle = encodeURIComponent(document.getElementsByTagName('title')[0].innerText);
43 const currentUrlBase = document.location.href.replace('localhost:8081', 'staging.trase.earth');
44 const currentUrl = encodeURIComponent(`${currentUrlBase}&print=true`);
45 const pdfUrl = `${PDF_DOWNLOAD_URL}?filename=${pageTitle}&url=${currentUrl}`;
46 window.open(pdfUrl, '_blank');
47}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

29function downloadPDFList()
30{
31 $("#pdfType").attr('value', 'range');
32 $("#pdfDate").attr('value', $("#date").attr('value'));
33 document.forms["pdf"].submit();
34}

Related snippets