Solved

Print PDF from BatchJob

Posted on 2012-04-11
13
523 Views
Last Modified: 2013-01-21
Hi Experts,

I have a customer question that I can't solve because it's an unknown area for me.

In a PF are records containing the name of a PDF that is stored somewhere in the network (90% on the  IFS). The customer likes to print the PDF by pressing a functionkey.
Because of some selection options, it's possible to select up to 20 PDF's in one shot, so they all must be printed (in a batch process).
I was able to print PDF's interactive on my PC, but I can't figure out how to print in batch.

help is highly appreciated :-)

Thanks,
Murph
0
Comment
Question by:theo kouwenhoven
  • 7
  • 2
  • 2
  • +2
13 Comments
 
LVL 18

Accepted Solution

by:
daveslash earned 200 total points
ID: 37835309
Greetings, Murph!

To my knowledge, there's no way to open the PDF and print it directly from the '400. You'll have to write a client application in a client language (such as Java, VB, or C#) that reads the PDF file-name from the table and opens the file.

I've done it from Java before, but I don't have the details on how I did it. I just know uit is possible.

Let us know if you need more guidance.

HTH,
DaveSlash
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 37835451
Hi Dave,

It is possible with AcrobatRader with conmmandlines parms /t /h , but only on a PC, when I try that on a W2003 server it is prompting some screen and I have to choose print from the menu, I'm not able to write java, so I will look in the office is someone can do that for me, any detail is welcome.

Regards,
Murph
0
 
LVL 6

Expert Comment

by:Jon Snyderman
ID: 37835682
Hi Murph,

I am dieing to chime in here but am coming up short.    I KNOW that you can send a PDF document to a PCL or PDF capable printer.   What I am not sure of is exactly how and which licensed programs are needed and how to send a pre-existing vs a converted spool file.   I think that, either PSF400 or AFP or IP1 options are involved and it has to do with the PSFCFG object (WRKPSFCFG).   But I dont know exactly how to make it happen.    But if you use that command and create a dummy object and play with the PDFGEN parameters, you may make some progress.  

Sorry for the lack of specifics, but I am almost positive that it can be done.  

~Jon
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 37836051
Hi Jon,

- Creating a printerfile and FTP the PDF to it is the way to create output for a PDF capable printer.
- The same is possible to do for PCL and postscript with tools like PDF2PCL etc. and then ftp that.

But the printer is unknown it could be any printer in the network from system printer to personal inkjet.

PDFGEN is not possible, because I have to print from a PDF archive from the past 5 years.

Thanks,
Murph
0
 
LVL 6

Expert Comment

by:Jon Snyderman
ID: 37837591
Got it.   I think you are on the right track with the PDF2PCL.  But how to send that to anything including a Client Access inkjet, that may be a challenge.    Sorry.  I will be interested to see if you make progress.   Unfortunately, I think you may be forced back to the remote command option.  

~Jon
0
 
LVL 27

Expert Comment

by:tliotta
ID: 37840836
...when I try that on a W2003 server...

Is this intended always to be routed through the same server? Or was that just one of the tests you ran to see what might work?

Of course, STRPCCMD PCCMD('start acrord32.exe /t c:\MyFile.PDF') is a valid example for most connected PCs; but it'd need to be RUNRMTCMD for a server instance. And if the /t flag doesn't work for the server, it's moot anyway. Further, it the path to the .PDF is for a shared directory back in the IFS, it'd probably need to be in a UNC format and the process would need to run on the server under an account that had access back to the server.

Tom
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 37841443
Tom,

I started on a W2003 server, because that was available, and I needed a place to execute AcrobatReader.
So I really don't care where the job is executed as long as it will print the PDF's.

Regards,
Murph
0
 
LVL 33

Expert Comment

by:shalomc
ID: 37843071
Sometimes it is time to use 3rd party tools.
http://www.silentprint.com/
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 37844114
Hi Shalomc,

I saw that already, but it's expensive, server version cost £4,999.00 + Annual Licence £1078.80, I also saw "Acrobat Wrapper" looks nice, but it's the same problem as my solution.

On this moment I'm able to print PDF's in batch on the server, but the process doesn't end because of the way Acrobat is working on a server.
so I created a batch file that start Acrobat with the right parms, wait for 5 seconds and then use taskkill to end the Accrobat process.

It works, since this afternoon, but if you try to print bigger PDF's, the task will be killed before completion.
I just missing a Acrobat parameter to tell the process to close after completion. An other option is preload Acrobat, than I can use a parm to use the available instance, this works also, but still looking how to pre-load Acrobat the right way.

I will keep you informed about the status

Thanks,
Murph
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 37882399
Hi friends,

I'm a step closer, however on this moment I can only print 1 page PDF's, but we are working on it. It will not be a native solution (or maybe I can make a native solution if this works)
0
 
LVL 18

Expert Comment

by:daveslash
ID: 38023197
Greetings, Murph!

Did you ever get this to work?  If so, how?

Regards,
DaveSlash
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 38023741
Hi Dave (a.o.),

On this moment we have a java solution that runs via an Win2008 server, this week I hope that I have time to move it to the As/400 and run it from CL instead of using PC servers.
The "problem" on this moment is that we have to define the printers we like to use on the same PC server, so the program is using the local printers. When we are able to approach the printers directly on the Printer server, we can move to AS/400.

Regards,
Murph
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 38137128
Status:

Hi All,

We have now a program that is polling a map, and will print every file that is in there as .PDF
The problem now is defining the right printer for a "dropped" file and the print must be installed as printer on the same server as where poller program is running.
For now every printer has his own map and poller, but should be nice to be able to have one map and be able to define the target printer in another way.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
as400 calendar 2 174
Catalog Index 9 123
Data transfer to iSeries failing with message ID SQL0462 6 158
SQL Stored Procedure Authority 3 20
Some of the SEO trends we might expect in 2017.
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question