Printing Postscript in Perl - Help

This is a discussion on Printing Postscript in Perl - Help ; Hi Everyone, I'm having a real hard time with this. Maybe some smarter people can assist. I'm running Mandrake 9.2. I have a Laserjet 4M Plus. I want to be able to print Postscript, bold, underline, different fonts, etc from ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Printing Postscript in Perl

  1. Printing Postscript in Perl

    Hi Everyone,

    I'm having a real hard time with this. Maybe some smarter people can
    assist.

    I'm running Mandrake 9.2. I have a Laserjet 4M Plus. I want to be
    able to print Postscript, bold, underline, different fonts, etc from
    within a Perl script.

    I have absolutely no idea where to start or what to do. My
    /etc/printcap file looks pretty shallow:

    HPLJ4|HP Laserjet 4:rm=nitelife:rp=HPLJ4:

    I set my printer up using the DrakConf program. I can print, but just
    not any formatted text or anything.

    I see so much information around, that I'm lost as to which really
    applies to me situation.

    Any help would be appreciated.

    Thanks,

    Arthur

  2. Re: Printing Postscript in Perl

    Arthur wrote:

    > I'm having a real hard time with this. Maybe some smarter people can
    > assist.
    >
    > I'm running Mandrake 9.2. I have a Laserjet 4M Plus. I want to be
    > able to print Postscript, bold, underline, different fonts, etc from
    > within a Perl script.
    >
    > I have absolutely no idea where to start or what to do. My
    > /etc/printcap file looks pretty shallow:
    >
    > HPLJ4|HP Laserjet 4:rm=nitelife:rp=HPLJ4:
    >
    > I set my printer up using the DrakConf program. I can print, but just
    > not any formatted text or anything.
    >
    > I see so much information around, that I'm lost as to which really
    > applies to me situation.
    >
    > Any help would be appreciated.


    Well... I don't know how helpful this will be, but hopefully it'll help you
    get a better idea of just what you want to do.

    PostScript is a programming language -- one specially designed for
    programming printers. It has commands to do things like "set this font as
    the default", "print this text string at this position", "draw a line from
    here to there", etc., etc. It also has more traditional programming
    language constructs -- 'if's, loops, variables, etc.

    It was designed to be easy for a printer to implement, so it's stack-based,
    which makes it different in many ways from more traditional programming
    languages. But it *is* a full programming language -- people have written
    web servers in PostScript. (Crazy people, some might say, but then, all
    programmers are a little crazy...)

    Raw PostScript is in many ways a pretty low-level programming language --
    there's a reason why people don't just write their documents in PostScript.
    It's *possible*, but it's far from easy with just the basic PostScript
    operators and functions.

    PostScript *isn't* a markup language -- it's not like HTML, SGML, etc., with
    text that's basically laid out the way it would be in the document, just
    with codes inserted to say "this should be bold, this should be italic"
    etc. (It's also not like the "languages" used by some old dot-matrix
    printers, where you could basically output a stream of text with special
    formatting codes in it for changing font, line spacing, etc.)

    The point here is that if you want a Perl script to output PostScript, what
    you're really doing is having your Perl generate a PostScript program.
    That's certainly not an impossible thing to do, but it will require you to
    learn and understand PostScript. If that's what you really want to do, the
    folks over in comp.lang.postscript can help.

    One thing that PostScript *is*, though, is extensible in itself. Just like
    there are the Net:: Perl modules that let you do networking in Perl without
    worrying about all the fussy details, there are people who have written
    PostScript "modules" that make it possible to write a document in a
    markup-like language and send it to a PostScript printer. Some examples
    are:

    Quikscript - http://www.cs.adfa.edu.au/~gfreeman/qs.html

    Minidict - http://www.cappella.demon.co.uk/tinyfiles/tinymenu.html
    (near bottom of page)

    Tinydict - same place, near top of page

    The creators of these seem to hang out in comp.lang.postscript, so you can
    probably get help on using them there. If your goal is formatted text,
    possibly with some tables and such, then those might well do for you.

    Another alternative would be to use a different format which there are tools
    for printing -- e.g., your program could output HTML, RTF, LaTeX, troff,
    etc., etc. You'd then need a program designed for printing whatever format
    you choose to use.

    --
    ZZzz |\ _,,,---,,_ Travis S. Casey
    /,`.-'`' -. ;-;;,_ No one agrees with me. Not even me.
    |,4- ) )-,_..;\ ( `'-'
    '---''(_/--' `-'\_)

+ Reply to Thread