xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Xmlgraphics-fop Wiki] Update of "PclOutput" by JeremiasMaerki
Date Wed, 12 Apr 2006 19:06:15 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The following page has been changed by JeremiasMaerki:

The comment on the change is:
Some notes on PCL support to be implemented

New page:
This page contains notes on the PCL renderer.

= PCL Links =

 * http://en.wikipedia.org/wiki/Printer_Command_Language

= Determining the implementation approach =

It's probably best to implement PCL 5 (and possibly PCL 5c for color output) which covers
printers since the HP LaserJet III back in 1990. Support for that should be widely available.
A big plus is TrueType support which makes it possible to efficiently paint large amounts
of text with different font sizes and without having to construct bitmap fonts.

PCL itself seems to be relatively unexpressive. You basically have three kinds of paint operators:

 * Text
 * Bitmap images
 * Rectangles

For more sophisticated operations you can switch to HP GL/2 but even that language doesn't
come near the expressiveness of PostScript. For example, you can only rotate in 90 degree
steps, even in HP GL/2. That means that at least for a Graphics2D implementation all the coordinate
system calculations will have to be done in Java. On the positive side, there are operators
in HP GL/2 for complex shapes and text painting in arbitrary directions (rotation).

There are two basic approaches for an implementation of the Renderer:

 * Use PCL text operators for FO text and PCL bitmap operators for bitmap graphics. Leaders,
borders etc. are painted using HP GL/2.
 * Use the Java2DRenderer to implement the FO part. A Graphics2D implementation will be necessary
anyway to handle SVG (if no bitmap should be produced). This will mean that PCL is only used
to set up a page and basically all painting would be done in GL/2 (except bitmap images for
which only PCL provides operators).

The second approach is probably easier to implement but would make it necessary to bring the
Java2DRenderer to the same quality as PDF and PS which should be done anyway at some point.
At this point it's difficult to say whether there is any downside to this approach. The documentation
doesn't give any hints that using GL/2 for text painting is any less efficient than text painting
in PCL.

A possible approach could be to start with the second approach above and then decide whether
to add special handling of FO text in the renderer (by overriding some methods implemented
by Java2DRenderer).

= What others did =

The PCL renderer from FOP 0.20.5 only uses PCL commands, default fonts and does not support
SVG. In FOP Trunk we now support different reference-orientations which starts to make the
renderer more complicated. Full PCL support will require some level of SVG support, too.

A Windows printer driver for the HP LaserJet 4 may output most text as bitmap images. That
probably depends on the font download setting, but it shows that it is quite feasible to paint
text as bitmaps, too. However, this is probably relatively inefficient because it uses a lot
of processing power in the JVM and makes the print files quite large.

To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org

View raw message