bobdeath has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to print a postscript file in perl. I have been looking at the Printer module but I don't see how I can get it to print anything but straight text. Anyone have any other idea?
  • Comment on printing postscript in unix and windows

Replies are listed 'Best First'.
Re: printing postscript in unix and windows
by hsmyers (Canon) on Jun 26, 2003 at 21:56 UTC
    Postscript is 'straight text'---it just happens to be text that the printer recognizes as its own printer control language. There are complications on printers that handle both text and postscript, but once you get the printer into postscript mode, things should work from there.

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
      it just happens to be text that the printer recognizes as its own printer control language

      Not all printers understand postscript. For instance, my cheap HP inkjet doesn't (and I know well, having tried a few times to start a conversation).



      The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket
Re: printing postscript in unix and windows
by Mr. Muskrat (Canon) on Jun 26, 2003 at 19:46 UTC

    If you're using *nix, it'll work but not on Winblows. The Printer docs say this:
    "...on Linux/UNIX the data passed to the print method can be anything which should be printable, i.e. groff/troff, PostScript, plain text, TeX dvi, but on windows the only data which can be handled by the printing system is plain text, GDI commands or flies [sic] written in your printer's interface language."

Re: printing postscript in unix and windows
by sgifford (Prior) on Jun 26, 2003 at 20:26 UTC

    Perhaps GhostScript.PM will do what you want.

    If it doesn't, your best bet may be just running ghostscript from your Perl script with system