1 year ago

#371158

test-img

suma_sl

Is it possible to delay or overwrite windows cannot find 'acrord32.exe' error message in java

I need to use both executable files of Adobe reader to open documents. acrord32.exe for the users using adobe acrobat reader and acrobat.exe for the users using adobe acrobat pro. I have used system parameters to get done the job. But my problem is that whenever I use the acrobat.exe version this error message is coming.

acrord32.exe error message

After clicking ok then my pdf file opens from acrobat.exe.

So I just want to delay/overwrite/remove this message by using java...

Here is my code

public static void openPDF(Container container, String fileName) throws Exception, PrintException {
   SystemParameterHome paramHome = (SystemParameterHome) container.getHomeForEntityBean();
   try {
    String pdfParameter = "PDF_COMMAND";
    SystemParameterObject pdfCommand = paramHome.findByPrimaryKey(pdfParameter);
    String command = pdfCommand.getStringValue();
    Process proc = Runtime.getRuntime().exec(command + " \"" + fileName + "\"");
    int exitVal = proc.waitFor();
    if(exitVal != 0) {
        System.out.println("exit value in if: "+ exitVal);
         pdfParameter = "PDF_COMMAND_64";
         pdfCommand = paramHome.findByPrimaryKey(pdfParameter);
         command = pdfCommand.getStringValue();
         Runtime.getRuntime().exec(command + " \"" + fileName + "\"");
         throw new PrintException("There was an error in printing. Please contact a system administrator.");
         
    }else {
        System.out.println("exit value in else "+ exitVal);
    }
    
   }
   catch (Exception e) {
    e.printStackTrace();
   }

java

adobe

acrobat

0 Answers

Your Answer

Accepted video resources