[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Print PDF from BatchJob

Posted on 2012-04-11
13
Medium Priority
?
540 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 600 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

650 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