v iv

Generation

generate functionFri, 16 Jun 2023

convert lotus notes document to pdf file

public static void createPDF(String documentPath, String pdfPath) { try { //set up path to lotus notes String lotusNotesPath = "C:\\Program Files (x86)\\IBM\\Lotus\\Notes\\notes.exe" //open lotus notes and export document to pdf ProcessBuilder pb = new ProcessBuilder(lotusNotesPath, "-x", "\"c:\\Users\\User\\Documents\\ExportToPDF.nsf\\ExportToPDF?OpenAgent\""); Process process = pb.start(); process.waitFor(); File file = new File("C:\\out.pdf"); File newFile = new File(pdfPath); if (file.renameTo(newFile)) { System.out.println("Renamed"); } else { System.out.println("Error"); } } catch (IOException | InterruptedException e) { e.printStackTrace(); } }

Questions about programming?Chat with your personal AI assistant