print preview on Windows works

From: Dominic Lachowicz <domlachowicz_at_gmail.com>
Date: Fri Mar 14 2008 - 19:04:23 CET

Hi all,

I just wanted to update everyone on my "get print preview working on
win32" sprint.

Right now, most (all?) things work properly. What I'm doing is
shunting each page's drawing commands into an EMF, and then inserting
that as a page in a multi-page TIFF file. The TIFF file is created @
your best printer's resolution. For me, this is 600dpi, so the text
looks really sharp (even if you can't tell that from the 50% scaling
and other artifacts in the attached screenshot). I'm using GDI+ for
all of my drawing needs. Only WinXP and newer ship GDI+ by default,
but there's a
re-distributable DLL from MSFT that works all the way down to (at
least) Win98. I'm using LoadLibrary/GetProcAddress, so there's no hard
compile-time or run-time dependency on GDI+. We should probably ship
this DLL with AbiWord anyway, since our "Win32 native" graphics plugin
can take advantage of it, so it'd have multiple benefits for our
users.

The multi-page TIFF is then opened by Window's document viewer. The
only problems I'm aware of is that it's a little slow and that it can
consume a good deal of memory. Both of these are because a vector
graphic is being rasterized at an "obscenely high" resolution. And
since it's already rendered @ your printer's resolution, it should
still look good if you print the preview images.

http://www.abisource.com/~dom/abiword-print-preview.png

I'll get this all committed shortly. Enjoy the eye candy,
Dom

-- 
Counting bodies like sheep to the rhythm of the war drums.
Received on Fri Mar 14 19:04:54 2008

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2008 - 19:04:54 CET