36

Google Chrome has the option to "Save as PDF" when you enter the Print dialog or use window.print(). The user needs to choose this option in the print dialog in order to save the page as a PDF.

Can I call some funcion or pass an argument to window.print() in Chrome to "print" the page as a PDF without the print dialog appearing?

Any ideas?

1 Answer 1

6

Unfortunately there isn't any param you can pass to window.print(); to force it to print to PDF unless there is a PDF driver plugin already present on the client's browser. (There are plugins for Firefox and IE: JS Print Setup and MeadCo Script respectively.)

You may want to look at MrRio/jsPDF, a tool to generate PDF files with client-side JS.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.