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
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