[GRLUG] print to file from web page inconsistent results

Michael Mol mikemol at gmail.com
Thu Mar 24 08:46:20 EDT 2011


On Thu, Mar 24, 2011 at 12:19 PM, Eric Beversluis
<ebever at researchintegration.org> wrote:
> Here's something that I've wondered about for a while:
>
> (Using Linux and Firefox):
> I often like to use the print to file option to capture webpages as pdf
> or ps (another feature that M$ chooses not to include--at least not the
> option to print to a useable format).

re Windows...Check out the CutePDF printer driver. It uses Ghostscript
to provide a PDF printer target driver on Windows. Also, the Fireshot
Firefox extension is nice, although I don't think it supports PDF, and
it sadly doesn't run on Linux.

>
> But while everything normally works nicely, with some webpages only the
> first (print) page or so of the web page gets printed to file. What I'm
> wondering if this is just something flukey that happens (it seems
> consistent--if I try again to print that webpage I get the same result)
> or if there's something in how the webpage is coded that's causing that.
> (I'm talking about printing the actual webpage as it appears, not the
> sometimes-available 'formatted for printing' option.)
>
> Does anyone else have this experience or happen to know the reason why?

There are at least three possible reasons I can think of.

First, CSS supports providing different rules for printing (even
without using a separate 'view printable form' link). Perhaps the
websites in question are leveraging that. (I beleve
Wikipedia/MediaWiki does, for example)

Second, it may be an aspect of Javascript. Perhaps part of the page is
populated after load, or after a mouseover event, or something like
that.

Checking Print Preview will help catch those two cases. I remember
that browsers _used_ to download a wholly fresh copy of a page when
they wanted to print, but that memory goes back to Netscape 4.x and
Mozilla. I don't know if/when that changed.

Third, it's possible that there's something quirky going on inside
your printer driver or PDF.  IIRC, CSS supports commands for
delineating pages, but I'm not certain.

-- 
:wq

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list