Web pages to print media -- solutions?

http://www.princexml.com/

could be something for you. It converts xml and html pages to pdf documents.


Using print CSS files is a really slick approach to reformatting pages for printing.

A lot of people fall back to PDF because it can be more powerful and easier.

For most things, though, I think CSS markup is simpler and easier.

Look at the source for pages in StackOverflow and you'll see references to media="print" (print.css)--a set of styles applied only when a browser prints the page.

<link href="/Content/print.css" rel="stylesheet" media="print" type="text/css" />

You can use these to hide navbars, ads (or show different ads). Do some basic pagination, etc.

If you need more control over things like margins, you have to go outside the browser (PDF, Word, XPS, etc.).


You may have heard of PediaPress, a company that has done a "wiki to print" (i.e PDF, but also ODF) deal with the Wikimedia Foundation. (See "Wikis Go Printable".) Their code is designed to work with MediaWiki and is open source.

But! It's even better than that. Check out this bookmarklet. You can use it to create PDFs or ODFs of any publicly-accessible MediaWiki page (maybe it needs the API to be enabled too...). And you can bundle multiple pages, from a single MediaWiki or multiple MediaWikis, into a single document. It's pretty freaking awesome in my book. :)

ETA: PediaPress have put significant work into making something that looks really nice to read. It's not just the equivalent of MediaWiki's printable version converted to PDF.