Tuesday, June 19, 2012

Chrome's "Print Preview" creates a PDF behind the scenes

While looking at a print preview in chrome recently (v 19 now, I believe), I noticed that the internal html for the print preview dialog simply generates a pdf on the fly. At first, I was hoping this would allow plugin-and-server-free ways of giving a "download as pdf" link, but unfortunately, it's locked down.


Chrome prevents pages from linking to everything under chrome://print, so there's no way for javascript to just call window.print(); window.location.href="chrome://print/zzz.pdf";

In the end, I was hoping there would be an easy way of at least linking to chrome's native "Save as pdf" feature, which may not be easily discoverable by computer novices. With this functionality built in, though, it would be interesting for chrome to make available a way for websites to save a pdf, or open up the print preview dialog with Save as PDF preselected. 

Good idea, or just another nonstandard javascript extension to support?

1 comment :

  1. You has a great blog. I'm very interesting to stopping here and leaves you a comment. Good work.

    Lets keep writing and blogging

    Nb: Dont forget to leave your comment back for us.

    ReplyDelete