[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

Print PDF from BatchJob

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
theo kouwenhoven
Asked:
theo kouwenhoven
  • 7
  • 2
  • 2
  • +2
1 Solution
 
Dave FordSoftware Developer / Database AdministratorCommented:
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
 
theo kouwenhovenAuthor Commented:
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
 
Jon SnydermanCommented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
theo kouwenhovenAuthor Commented:
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
 
Jon SnydermanCommented:
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
 
tliottaCommented:
...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
 
theo kouwenhovenAuthor Commented:
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
 
shalomcCommented:
Sometimes it is time to use 3rd party tools.
http://www.silentprint.com/
0
 
theo kouwenhovenAuthor Commented:
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
 
theo kouwenhovenAuthor Commented:
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
 
Dave FordSoftware Developer / Database AdministratorCommented:
Greetings, Murph!

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

Regards,
DaveSlash
0
 
theo kouwenhovenAuthor Commented:
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
 
theo kouwenhovenAuthor Commented:
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 7
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now