printing a pdf

Joined
Nov 6, 2007
Messages
1
Reaction score
0
Hi

I have a class which prints a PDF. It works well when done through the eclipse ide. But when i jar it and run from the oracle forms, nothing happens. It does not print anything nor throws an exception. Any help is greatly appreciated.

Below is the code snippet of the java program.

String printCommand = QUOTE + p_AcrobatPath + QUOTE + SPACE + ADOBE_READER_PRINT_COMMAND + SPACE + QUOTE + p_PdfDocumentName + QUOTE + SPACE + QUOTE + pname + QUOTE;

System.out.println("Printer Name is "+pname);
try
{
adobeBackGroundProcess = Runtime.getRuntime().exec(p_AcrobatPath);
adobeProcess = Runtime.getRuntime().exec(printCommand);
int exitVal = adobeProcess.waitFor();
if ( exitVal != 0 ) {
throw new Exception("[printPDF] Adobe Reader process exitVal : " + exitVal);
}
} catch (Exception e) {
System.err.println("[printPDF] Error printing PDF : " + p_PdfDocumentName);
e.printStackTrace();
}
finally {
if (AdobeBackGroundProcess != null) {
System.out.println("AdobeBackGroundProcess Destroyed..");
adobeProcess.destroy();
adobeProcess = null;
adobeBackGroundProcess.destroy();
adobeBackGroundProcess = null;
}
}

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top