Re: Print .pdf documents to ASCII Printers (0/1)



Dear Daniel,

As I see it, you have two distinct steps to accomplish in printing the
pdf files that are stored on your IBM i5-iSeries-AS/400 server in the
IFS.

1. Create a spool file format compatible with the target printer's
capabilities.

2. Successfully deliver a spool file to a particular printer.

For printers with native support for printing pdf files, step 1 is
automatically complete. I provided some assistance to someone back in
December via the comp.sys.ibm.as400.misc newsgroup who wanted to print
pdf files stored on their server's IFS. All of their target printers
were capable of printing pdf's directly. They posted their code to the
newsgroup once they had the solution up and running.

The print file QSYSPDF was a copy of QSYSPRT with the device type set
to *USERASCII and the replace unprintable character action changed
from *YES to *NO.

On 15 Dec 2004 08:35:35 -0800, in
comp.sys.ibm.as400.misc you wrote:

Hi Paul...
I have found the solution:


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <recio.h>

#define LEN_BUF 132

int main(int argc, char *argv[]) {
FILE *infile;
_RFILE *prtf;
char buffer[LEN_BUF+1],FileList[11];
int len=LEN_BUF;

infile = fopen(argv[1],"rb");
sprintf(FileList,"QSYSPDF");
prtf = _Ropen(FileList, "wr lrecl=132 ");

while( len>0 ) {
memset(buffer,0x00,sizeof(buffer));
len=fread(buffer,sizeof(char),LEN_BUF,infile);
_Rwrite(prtf,buffer,LEN_BUF);
}
fclose(infile);
_Rclose(prtf);
return 0;
}


in this way I can send a pdf file into the correct OS/400 OUTQ.

Because the files stored in the IFS are in stream file format, you
need to set the lrecl=132 to get the buffering correct when the file
is passed into an OS/400 OUTQ for delivery.

One other thing I normally do in the printer file is to change the
parameter

Unprintable character action:
Replace character . . . . . . from its default of *YES to *NO.

This is just additional safety suggesting to the operating system that
it should not change anything.

I believe you should be able to use the code snippet from above to
develop a batch method of transferring files from the IFS into i5 OS
or OS/400 defined printer queues for printing. This idea assumes that
the printers, which need to print the pdf's, are already serviced by
some form of printer device description or remote output queue on the
IBM i5-iSeries-AS/400 host.

Further information regarding point #1
--------------------------------------

It is quite likely that some of the printers on your list will not
support native printing of pdf files. To service these printers, you
will need to change the format of the pdf to a printer language that
the printer supports.

The URL's listed below will bring you to a few commercial sites, which
offer tools for automating the printing of pdf files.

Conceptually you will find that most all of them work by calling the
Adobe Acrobat Reader program via a command line interface and
executing a print of a document to a defined default printer. This
process can be successfully executed with the i5 OS - OS/400 RUNRMTCMD
option or by a visual basic program running in the background on a PC
as well.

If you build a homegrown visual basic program to perform this task,
there is a nice visual basic toolset to retrieve the available printer
options from a target Windows print driver and then specify a
particular feature (such as input tray selection) when your VB
application executes. The two html files attached to this e-mail are
from the Microsoft support web site. They explain the visual basic
printer control feature in more detail (including example programs).
Thus with visual basic, you can call for the Adobe Acrobat Reader
application to open and print a pdf file, while specifying the printer
properties to use as well.

http://www.gdps.dk/products/watchDir/watchDirectoryPrintPDF.shtml

http://www.pdfstore.com/details.asp?ProdID=39

http://www.artspdf.com/arts_pdf_crackerjack.asp

http://www.traction-software.co.uk/batchprint/associations.htm

What you could do is to create a shared folder between the IFS
directory with the pdf files and either an internal XFS card or an
external PC with Adobe Acrobat Reader. You could then use the
RUNRMTCMD concept to call for Adobe Acrobat Reader to open a pdf
stored on the IFS and print it through a Windows print driver
compatible with one of the models of printer that doesn't support
printing pdf's directly. The result of the printing could be printed
to file and placed in a designated receiving folder on the IFS. It
would then be possible to use the example code concept from above to
deliver the *.prn file format of pdf to the appropriate printer.

These are some ideas about how to maintain the printing control of the
documents at the IBM host. You could also create a batch process to
offload the work to a different server but the IBM host would then not
necessarily know whether all documents were successfully printed or
not.

HTH

Best Regards,

/Paul
--
Paul Tykodi
Principal Consultant
TCS - Tykodi Consulting Services LLC

Tel/Fax: 603-343-1820
Mobile: 603-866-0712
E-mail: ptykodi@xxxxxxxxxx
WWW: http://www.tykodi.com


On Wed, 20 Apr 2005 17:45:10 +0200, Daniel
<nospampls.lapin@xxxxxxxxxxx> wrote:

Hi

I am receiving .pdf document by some application which stores them in
IFS.
Now I d like to print them to printers on my LAN (non IPDS Printers).
I did not find any command to print these .pdf files.

Is there a way to do it or do I need some additional tools (and
which)?

thanks for your help

Daniel Herren



On top of my wishlist would be:
PRTIFSOBJ
OBJ('\ThePdfDocuments\Invoice123.pdf')
OBJTYPE(*PDF)
PRINTER(PRTHP4000)
;-)

.



Relevant Pages

  • Re: Printing PDF files to networked printers
    ... Are users that are having problems printing and ones that are not printing ... > We have about 30 people using this, 10 or so cannot print any PDF files. ... with the same drivers can while otheras can't. ... > the print server, I've tried different drivers. ...
    (microsoft.public.windows.server.general)
  • Re: [opensuse] pdf character spacing/alignment problem
    ... I have a problem related to the creation of pdf files. ... but the resulting file has lots of spacing problems. ... The same happens when printing from OOo also. ... I also tried opensuse 10.3, which gives a different output, ...
    (SuSE)
  • Re: Will printers accept PDF files for *EVERY* type of project?
    ... description language that revolutionized the printing industry and is responsible for today's ease of producing printing plates and direct computer to press printing. ... *ANY* printer who won't accept PDF files is working in the dark ages of making plates by taking photographs of artwork and developing a film they print the plates from. ... Composite black is a mess at the best of times. ...
    (alt.graphics.photoshop)
  • Re: How to speed up printing PDF files??
    ... I use Foxit Reader to read and print PDF files and the speed of ... printing is still the same as in Acrobat Reader. ... The fact that it only happens with PDF files means that it's not the ... Then download the newest driver off of HP's website and reinstall it. ...
    (comp.periphs.printers)
  • Re: How to speed up printing PDF files??
    ... I use Foxit Reader to read and print PDF files and the speed of ... printing is still the same as in Acrobat Reader. ... The fact that it only happens with PDF files means that it's not the ... Then download the newest driver off of HP's website and reinstall it. ...
    (comp.periphs.printers)