× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi James,

>       Would you please explain how you got raw PS to attached printer.
>
>       I could never get it to print directly.
>
>       Had to write to IFS and then using PrintFile or Ghostscript to send
> to printer defined as text/generic.

I actually do write it to a stream file first, because I don't know at the
time that the data is generated whether it's going to be sent to the
printer or whether it's going to be e-mailed.

If it's going to be e-mailed, I use the ps2pdf utility from Ghostscript to
convert the data to a PDF document, and then I e-mail that.

If it's going to be printed, I use the following code snippet:

D wkBuf           s            132A
   .
   .

   wwIn = open(peFileName : O_RDONLY);
   if (wwIn < 0);
      ... I put an error on the screen and abort if this happens  ...
   endif;

   wwCmd = 'OVRPRTF FILE(QSYSPRT) DEVTYPE(*USERASCII) DEV(' +
         %trim(peDev) + ') OUTQ(' + %trim(peOutq) + ')';
   QCMDEXC(wwCmd: %len(wwCmd));

   open QSYSPRT;
   wkBuf = *ALLx'20';

   dow (read(wwIn: %addr(wkBuf): %size(wkBuf)) > 0);
      except;
      wkBuf = *ALLx'20';  // x'20' = ASCII BLANK
   enddo;

   callp close(wwIn);
   close QSYSPRT;

   wwCmd = 'DLTOVR FILE(QSYSPRT)';
   QCMDEXC(wwCmd: %len(wwCmd));
   .
   .
OQSYSPRT   E
O                       wkBuf              132

The key to the entire process ithe DEVTYPE(*USERASCII).  This tells OS/400
to send the data to the printer as-is without any modification.

As I mentioned before, this also means that you lose a lot of the features
of the spooler.  You can't view the document, or see how many pages it is,
or print a page range.

On the other hand, after doing a ps2pdf on the stream file, I can view it
with Acrobat Reader, and print a page range from the PC if I want to --
just can't do it from OS/400.

It's not a problem for me because the user is looking at a purchase order
on the screen when he has the option to print it, and it prints the one
PO, which is usually about a page long, sometimes two... so printing a
page range isn't very useful in our case.  PostScript works very well in
this case.

Plus, we have Hylafax running on a FreeBSD server (the same one that we
use for Ghostscript/ps2pdf) and it's able to send a PostScript document as
a fax...  that way, anyone can fax a document directly from any 5250
terminal...

But, now I'm rambling... :)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.