开发者

Webpage as is to PDF [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I have different webpages that simulate single A4 press pages.

I'm looking for a method to save these as PDF exactly as they render on the browser (images, fonts, styles, margin...) without adds like text headers, footers, pagination or anything else.

I tried with fake printers like pdfcreator or adobe pdf printer but they add header/footer and the resulting PDF it's not exactly as the browser.

I'm open to php server, de开发者_JAVA技巧sktop software, browser plugin... solutions Anyone has one for this?


Thanks all for the tips, but because I cannot change customer print settings everytime it needs a specific kind of print instead of the default print settings, I've looked for a different solutions and I've found wkhtmltopdf that do what I'm looking for and the result is fine.


The additional header and footers when printing a web page have nothing to do with the PDF printer drivers. It's the web browser adds them. You'll need to use a web browser that allows you to change/remove these headers in the print settings (not all browsers do).


I use http://pdfmyurl.com to save pages as PDF.

Also if your on a Mac, there is a nice GUI app called Paparazzi: http://derailer.org/paparazzi/

and a CLI tool that uses webkit to take screenshots of webpages: http://www.paulhammond.org/webkit2png/


I think the easiest way to do this would be to create a print stylesheet where you hide the header/footer and other page elements you don't want to appear, and then print the page with Adobe PDF printer.

Note that by default most browsers will not print your background images. If you want them to print as well, you will have to set this up in the browser print settings. I believe Chrome doesn't have a way to do this yet, but it can be done in IE9, IE8 and below, and Firefox.

You can also tweak the settings to have the browser not include the page title, URL, and pagination to your printed pages.


You can turn off headers and footers in the Print Options dialog in Opera and Page Setup dialog in IE/Firefox. You can select these dialogs from the File menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜