converter from PCL to PS

2007-12-25 11:33:00

Hello.

Follwing was my original question:

leideck@pi3.informatik.uni-mannheim.de said:

> Hello. It's probably not the right group but i need a tool which can

> convert pcl-output from a hp laserjet 5si to postscript. Thanks in

> advance Wolfgang

And here is my summary:

The lj2ps converter mentioned in the comp.lang.postscript-faq is the only

free available converter that i have found. Unfortunately it has some limitations.

Here the contents of the enclosed limitations.doc

Program: lj2ps, 1.1 (release)

File: limitations.doc

Author: Christopher Lishka

Organization: Wisconsin State Laboratory of Hygiene

                Data Processing Department

Date: April 25th, 1990

Last modified: June 30th, 1990 by Chris Lishka

This file contains known limitations of the lj2ps program. The

limitations come in two basic varieties: (a) those that exist because

of inherent differences between the LaserJet and LaserWriter; and (b)

those that exist because I do not have enough time to fix them. All

limitations listed should be assumed to belong in the second category

unless otherwise noted.

* As has been mentioned many times in the documentation, I did not

  have time to implement all LaserJet commands in PCL 4 (let alone PCL

  5). Instead, I leave this as an exercise for the reader ;-) I have

  implemented what was needed by my organization, and represents a

  subset of PCL 4 which supports (fairly completely) page motion, page

  setup, and internal and cartridge fonts. Commands which were left

  out include:

  ** Macros

  ** Position stack

  ** Graphics -- patterns and grayshades

  ** Graphics -- bitmaps

  ** Secondary font support

  ** Downloadable fonts

* Although I put a fair amount of work into the Test Suite and Metrics

  Suite, they are by no means complete. They do test a fair amount of

  LaserJet quirks, and proved to be very helpful in fine tuning lj2ps.

  Feel free to add more tests to either suite.

* Tabs do not work exactly like the LaserJet when using proportional

  fonts. This is because a given tab position depends on the current

  location of the cursor, which might be different from the LaserJet

  and LaserWriter. Therefore, when a proportional font is used, tabs

  might end up in the wrong places. However, tabs are not a good

  thing to use with a proportional font anyway. Note that tabs used

  with fixed-width fonts should behave exactly the same way.

* Another problem related to tabs is the mechanism I have used. On

  the LaserJet, tabs are counted out using characters printed. To

  move to the next tab stop, the LaserJet will simply insert enough

  space characters to reach a position which is a multiple of eight

  characters. With proportional fonts, this results in tab stops not

  being in fixed columns, but rather dependent on the width of the

  characters printed before the tab. (I think this method is

  downright foolish, because it renders the purpose of tabs useless

  with proportional fonts). I have chosen to calculate tabs as being

  in columns, with the distance between columns being eight space

  characters in the current font. This allows tabs to be used to line

  up text at each tab stop with proportional fonts. Note that

  although the two schemes give different results with proportional

  fonts, the behaviors match exactly when using fixed-width fonts.

* The HMI command cannot be fully implemented. This is an inherent

  problem with the lj2ps program. The HMI command on the LaserJet

  works in one of two ways:

        (a) If the font is non-proportional, then the HMI command

            adjusts the individual width of each character;

        (b) If the font is proportional, then the HMI command only

            adjusts the width of the *space* character.

  Unfortunately, lj2ps uses a crude font mapping mechanism for

  emulating LaserJet fonts in PostScript. One of the inherent

  limitations is the inability to adjust the individual width of each

  character in the PostScript font. It is for this reason that the

  HMI command cannot be fully implemented. Unfortunately, there is no

  good way to fix this without overhauling the font mapping mechanism.

  The HMI command *does* change lj2ps' notion of the current character

  spacing (in the variable char_width). This is useful for doing

  horizontal tabs using columns. This is why the HMI command has been

  implemented at all.

* The postscript file produced by lj2ps is definitely not suitable as

  encapsulated postscript. One important example is that the

  "initclip" command must be used when resetting the right margin to

  insure that the clip-path can "grow" if the right margin gets

  bigger.

* To effectively emulate LaserJet relative horizontal motion commands

  with the current font mechanism, I had to move horizontal motion

  into the generated PostScript program. Therefore, although

  horizontal motion is tracked in lj2ps, it is only updated every time

  an absolute horizontal motion is performed (including non-command

  motions such as newline). This makes the horizontal cursor position

  in the lj2ps program innaccurate much of the time. The only fix I

  can think of is to replace the font emulation mechanism with

  something better. Note that vertical motion is tracked completely

  in lj2ps, and is of little importance in the generated PostScript

  code.

Greetings

Wolfgang


--
Wolfgang Leideck * University of Mannheim * Dep. PI III
A5, C220 * D 68131 Mannheim
Phone: +49 621 292 1100 * Fax: +49 621 292 3394
Email: leideck@pi3.informatik.uni-mannheim.de

Comments

Got something to say?

You must be logged in to post a comment.