I was able to open a page from a * .pdf file in Acrobat by java from this code:
try {
File pdfFile = new File("C:\testes\teste.pdf");
if (pdfFile.exists()) {
String cmd = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe";
String param1 = "/A";
String param2 = "page=2";
String[] cmds = new String[]{cmd, param1, param2, pdfFile.getAbsolutePath()};
Process p = new ProcessBuilder(cmds).start();
/*if (Desktop.isDesktopSupported()) {
//Desktop.getDesktop().open(pdfFile);
} else {
System.out.println("Awt Desktop não disponível");
}*/
} else {
System.out.println("Ficheiro inexistente");
}
System.out.println("Done");
} catch (Exception ex) {
ex.printStackTrace();
}
Is it possible to do the same with the browser with JSP?