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)
;-)
For more information or a FREE demo version of the Office Integrator, check
out our web site or feel free to contact me directly.
Regards,
Richard Schoen
RJS Software Systems Inc.
"Providing Your....iNFORMATION NOW!"
Email: ric...@rjssoftware.com
Web Site: http://www.rjssoftware.com
Tel: (952) 898-3038
Fax: (952) 898-1781
Toll Free: (888) RJSSOFT
"Daniel" <nospamp...@datacomm.ch> wrote in message
news:fmtc61lao479tqjop...@4ax.com...
There are a number of ways you could solve problem #1.
1. Write a CL program with a command front end. The CL program would
need to copy the stream file to a DB file making sure no CCSID
converions of data occurs. Then copy the data from the DB file to a
printer file with the device type set to *USERASCII. Through file
overrides, I believe you could skip going to the DB file.
2. Write a C (or other language that can work with APIs well) program to
open the ifs file and write the data to a *USERASCII printer file
3. Use the QIMGCVTI API to move the data from the IFS file to a spooled
file.
Once you have the .PDF in the spooled file, you now have to know what
capabilities your printers have.
1. If your printers can take PDF directly (I believe PS level 3 or PCL 6
printers usually have that capability), you can just send the file
directly to the printer through whatever configuration you currently have.
2. If your printer is not capable of taking PDF directly, you would need
to use a PDF to AFPDS transform that is part of the InfoPrintServer/400
product (this assumes you want an IBM solution and are willing to spend
the $$$$). At this point, once you've converted to AFPDS, you might as
well go to an IPDS printer to get the better support...but, you wouldn't
have to...you could attempt to use Host Print Transform. As long the
AFPDS generated does not contain AFP that HPT won't support your
probably ok. Course in this case, you need to do a double transform and
would require you write something to respool the data as an AFPDS
spooled file.
3. A third party solution...which may also solve problem #1...
Daniel wrote:
--
Rodney A Johnson
Technical Team Lead for AS/400 Spool
Dept GJC
IBM Rochester, Minnesota
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, IBM. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
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: pty...@tykodi.com
WWW: http://www.tykodi.com