This content has been marked as final. Show 12 replies
For more infomation.. I'm using the Oracle forms 10g version.
Hi1 person found this helpful
Use a host command, either directly or through webutil to issue an OS command.
Or use a java-bean to issue the print command.
Are you printing from the OAS server or the pc client?
Thanks for your reply..! We use the OAS server... If you don;t mind, can you please show me some code snippet, on how to call the functions which you have mentioned.
If you were going to issue an OS command to print a PDF from the OAS can you show me what that command would look like?
I was trying to use this type of command ..
HOST (lpr - P <printer_name> <filename_with_full_path>)
will this work out.? Is there any other way?
No, you cannot use lpr here. The host command is good, but you have to use Acrobat Reader to print a pdf file
Better still, use some special utility that prints pdf files. Google for "pdf print via command line" and you will find several examples.
Will any Webutil utiliies function will help me out to resolve this issue..?
With webutil you can use client_host instead of host, but it remains the same: you need some other program to print.
Let me change my previous answer about lpr command. I'm not so familiar with Linux, but after a bit of googling I saw that CUPS does print pdf files.
So, if you use CUPS it should work. However, you probably need to use a script to print a file. When using HOST, the are no environment variables set. Use the full path to the script, not just HOST(myscript.sh).
Don't know if cups directly supports PDF printing. But I have done it to convert PDF to postscript(at the time I was not using cups). I suppose cups could do similar conversion internally. The problem with this approach is you will only be able to print it on printers visible to application server. If you have a requirement of being able to print on the printer visible to client only then using orarp(something like that) utility or better yet using forms java bean is the way to go. I would vote for java bean where you can simply use java "built-in" printing capabilities and you are good to go with PDF printing.
Which Java built - in has tthis facility to print the pdf's... ?
Maybe I have mislead you by saying Java built in. As many things the correct answer would be it depends. I can tell you how I did it. I have an Oracle report server which is capable of generating PDF file. This is not your case but I suppose you also have generated PDF files. Second step is to enable some kind of protocol to access this generated PDF from client machine. In my case I have done it by enabling http access. The rest is the programming part in java to download PDF to client and send it to printer the user has selected through printing dialog.
Maybe I should mention the Report server I use generates PDF files with font subsetting to be able to print it in iso latin2 character set. And yes I have also used third party org.apache.pdfbox component to be able to set peagable for PrinerJob.
Hope you got some idea. Java bean I have wrote is very specific to my environment as it has to be tightly integrated into Oracle Forms so I don't think it would be of any help. Maybe you can take a look at this example http://forms.pjc.bean.over-blog.com/article-6621538.html as it is quite similar what I suggested.