1

I'm using OS X and I see on chrome that I can Save as PDF in the print window if I set the destination to "Save as PDF". Does this functionality exist in Windows?

Is there any way I can take advantage of this and have it save to PDF with just a click of a button? How can I open up the print page and save that as a PDF? Can I set the default destination to "Save as PDF" and then programmatically click the "Save" button?

Edit: I have tried to use jsPDF but was unable to pull the CSS.

1

3 Answers 3

1

there is also an option to print PDF on Windows 10. This javascript code opens a print dialog:

window.print(); 
Sign up to request clarification or add additional context in comments.

1 Comment

I can get the print window to pop up on both Mac and Windows, but how can I set the default print destination to "Save as PDF?" From here how can I use javascript to click "Save?"
0

I have used PhantomJS before to render PDFs from webpages programmatically. You'd have to write a PhantomJS script to accomplish that but they have helpful examples documented.

1 Comment

Important: PhantomJS development is suspended until further notice (more details). github.com/ariya/phantomjs/issues/15344
-1

jsPDF is a good tool for this.

This question is a possible duplicate of Download a div in a HTML page as pdf using javascript, which provides a demo and sample usage for jsPDF.

1 Comment

Please don't write an answer pointing to a duplicate. Instead, click the flag link under the question and select the duplicate reason.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.