0
public static void main(String[] args) throws IOException, BiffException {
Workbook workbook = Workbook.getWorkbook(new File("C:\\testes\\teste.xls"));
Sheet sheet = workbook.getSheet(0);
int linhas = sheet.getRows();
File pdfFile = new File("C:\\testes\\teste.pdf");
System.out.println("Iniciando a leitura da planilha XLS:");
for (int i = 0; i < linhas; i++) {
Cell a1 = sheet.getCell(0, i);
Cell a2 = sheet.getCell(1, i);
Cell a3 = sheet.getCell(2, i);
String as1 = a1.getContents();
String as2 = a2.getContents();
String as3 = a3.getContents();
if ("-".equals(as2)) {
System.out.println("Coluna 1: " + as1);
System.out.println("Coluna 2: Completar ");
System.out.println("Coluna 3: " + as3);
Desktop.getDesktop().open(pdfFile); //Abri o arquivo PDF na primeira página
} else {
System.out.println("Coluna 1: " + as1);
System.out.println("Coluna 2: " + as2);
System.out.println("Coluna 3: " + as3);
}
}
workbook.close();
}
I tried to change the line that calls the pdf file to:
Desktop.getDesktop().browse(new URI(pdfFile.toURI().toString() + "?page=2&zoom=10"));
But the parameters were ignored.
Already tried to execute as process?
acrobat.exe /A "page=2" "C:/testes/teste.pdf"
– Renan Gomes
I’ve never used it like this, it would have to give me an example of how to run as a process?
– R.Santos
You want to open the file on a given page or open "page x" and manipulate its content in your application?
– Renan Gomes