v iv

Generation

generate functionFri, 16 Jun 2023

create pdf from lotus notes document

public class NotesDocument2PDF { public static void main(String[] args) throws Exception{ // Setup the session to the local database. // Change the notes file path to a valid one on your system NotesThread.sinitThread(); Session session = NotesFactory.createSession("hoge", "hoge", "hoge"); Database db = session.getDatabase("hoge", "hoge.nsf"); // Create a new PDF document com.lowagie.text.Document document = new com.lowagie.text.Document(); // Setup the output file String outputFile = "/Users/hoge/hoge.pdf"; PdfWriter.getInstance(document, new FileOutputStream(outputFile)); // Open the document document.open(); // Create a renderer object NotesDocumentRenderer renderer = new NotesDocumentRenderer(); // Get the document to render Document notesDoc = db.getDocumentByUNID("hoge"); // Render the document renderer.renderDocument(

Questions about programming?Chat with your personal AI assistant