Solved

Print PDF from BatchJob

Posted on 2012-04-11
13
495 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 16

Author Comment

by:theo kouwenhoven
Comment Utility
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
Comment Utility
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
Comment Utility
...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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 16

Author Comment

by:theo kouwenhoven
Comment Utility
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 32

Expert Comment

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

Author Comment

by:theo kouwenhoven
Comment Utility
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
Comment Utility
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
Comment Utility
Greetings, Murph!

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

Regards,
DaveSlash
0
 
LVL 16

Author Comment

by:theo kouwenhoven
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now