Re: can I use perl to write a Postscript file and send it to the printer?

From: Robert Bonomi (bonomi_at_host122.r-bonomi.com)
Date: 11/06/05


Date: Sun, 06 Nov 2005 03:23:27 -0000

In article <1131116366.296606.265400@g49g2000cwa.googlegroups.com>,
 <lkrubner@geocities.com> wrote:
>
>I have a shell that is working fine. It gets some data from the
>database and sends it to the printer. But now I need to change it.
>
>The information we get from the database is in regards to the
>photographs that our graphics department has taken. For clarity sake,
>we would like to start printing out the image itself, along with all
>the data about it.
>
>I know how to send pure text to a printer, but I don't know how to send
>formatted text and images to the printer.
>
>I have an idea how to proceed, someone please tell me if this will
>work. I will write a Perl script that does the following:
>
>1.) Takes some text and the address on the harddrive of an image.
>2.) Wraps this in some Postscript to format it.
>3.) Save the text/image/postscript to the harddrive with a name like
>"fileToPrint.ps"
>4.) Call lpr - v "fileToPrint.ps" to send it to the printer.

You don't have to 'save to the harddrive'. you can simply 'pipe' the
data to "stdin" of the lpr program.

You conceal the required 'magic' in step 3. You have to have 'smarts'
there that know how the image is presently stored on disk, that can
read that file format, and output the requisite "PostScript format"
rendering of that image into the data-stream sent to the PostScript-
capable printer.

The '-v' option is *probably* not appropriate for a PostScript file.
>
>Would that work? And what is the correct extension for the file? "ps"?
>"eps"? Something else?

On Unix, the print spooler generally "doesn't care" *what* the file name
is. If the print spooler supports PostScript, _or_ the printer itself
understands PostScript, then, if the file starts with the PostScript
"signature", ("%!PS-Adobe") it is treated as a Postscript program, otherwise
it is treated as simple ASCII.



Relevant Pages

  • Re: Fontmap file for GhostScript
    ... >> Postscript document you know quite well what you use and what you ... I would find better format than PS. ... Helvetica Narrow ... ITC Avant Garde ...
    (comp.os.os2.utilities)
  • Re: OT: Word oder nicht Word
    ... Das trifft auf Microsofts DOC-Format nicht zu, das trifft nur auf Rich-Text Format zu, aber Word implementiert manche Sachen "eigenwillig" im Vergleich zur RTF-Spezifikation. ... Nein, nicht PDF als Outline, sondern PDF mit den zusätzlichen Schriften inkludiert! ... Ebenso bei PostScript oder EPS, falls Du sowas überhaupt noch kennen solltest;-) ... Aber Microsoft selber bietet ja XDOC an, was mal wieder was völlig Neues ist und somit zum Alten in keinster Weise kompatibel ist ... ...
    (de.comp.security.misc)
  • Re: Append image file to ASCII text file
    ... an image file to an ASCII text file. ... convert the text file into postscript and then append the signature ... to convert your images to eps format with a tool like convert ... Encapsulated Postscript (EPS) ...
    (comp.os.linux.misc)
  • Re: Exporting Postscript for image processing
    ... it seems I need an intermediate vector file format. ... PostScript isn't a 'format', its a language. ...
    (comp.lang.postscript)
  • Re: Exporting Postscript for image processing
    ... it seems I need an intermediate vector file format. ... PostScript isn't a 'format', its a language. ...
    (comp.lang.postscript)