Solved

Print PDF from BatchJob

Posted on 2012-04-11
13
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
  • +2
13 Comments
 
LVL 18

Accepted Solution

by:
Dave Ford 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
Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

 
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:Dave Ford
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
We take a look at some of the most common obstacles that IT teams run into as they work relentlessly to keep all the alarms and sirens from going off at once.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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