PDF Printing support from Python

Mike Meyer mwm at mired.org
Sat Apr 23 18:31:22 EDT 2005


Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:

> On Fri, 22 Apr 2005 17:41:22 -0500, Mike Meyer <mwm at mired.org> declaimed
> the following in comp.lang.python:
>
>> No, you don't. My print system does that, and I don't have acrobat
>> installed. I have ghostscript installed, which includes pdf2ps - which
>> handles this particular translation.
>>
> 	Okay, so you've converted one page layout language (PDF) to
> another (PS)... To actually print it you still need a RIP. A PostScript
> laser printer has the RIP built-in, but consumer level Windows printers
> do not have a PostScript RIP -- and some printers don't even have their
> own specific RIP built-in ("winprinters" put the RIP into the software
> driver that runs on the Windows machine, rather than sending drawing
> commands to the printer for rendering).

RIP? That term is to generic for google to be much use.

If you're saying you need a tool to convert from PDF to whatever the
printer understands, you're right. You can't avoid that. On Unix, PS
is used as the "universal" printer language. Unix vendors selling
printers sold PS printers 20 years ago. That's when apsfilter showed
up on the scene, automatically converting everything to PS to send it
to the printer. (These days, magicfilter is a much better tool than
apsfilter, though it's harder to install). That's why a "competent"
printer installation these days will include ghostscript (or something
equivalent) to drive the printer, and why my primary printer speaks
PostScript.

I disagree with your description of WinPrinters. Those are printers to
stupid to handle flat ASCII, so your computer has to convert flat
ASCII files to postscript or some other graphics format before you can
print them. (This is where magicfilter beats apsfilter - apsfilter
converts ASCII to PS to graphics images, whereas magicfilter can pass
the text straight through. This has caused apsfilter to fail on some
systems where magicfilter would work like a charm).  Such printers
typically only come with drivers for Windows, and are completely
useless - unable to even print flat ASCII text - on other systems,
hence the moniker "WinPrinters". Non-winprinters can be used to print
flat ASCII without a driver of any kind. GhostScript now includes
graphics drivers for several winprinters.

The only way to have Python render PDF (or PS, or JPEG, or any other
graphics format) without a "driver" of some kind is to write the
driver in Python. That's a pretty silly thing to want to do. For one
thing, the performance will probably suck. For another, there are lots
of drivers already written that you can use.

The only thing better than writing it in Python is finding that
someone else has already written it.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list