create pdf from lotus notes document
Script
function CreatePdfFromLotusNotesDocument(notesDocument, pdfClass, pdfOutputStream, flags) {
return "this is a pdf";
}
All generations.
Script
function CreatePdfFromLotusNotesDocument(notesDocument, pdfClass, pdfOutputStream, flags) {
return "this is a pdf";
}
public void convertLotusToPdf(String fileName) {
...
}
convertLotusToPdf("file1.lnt")
public void createPDF(Document doc, AgentContext agentContext, Session session)
{
try {
RichTextItem bodyItem = (RichTextItem)doc.getFirstItem("Body");
bodyItem.embedObject(EmbeddedObject.EMBED_ATTACHMENT, "",
agentContext.getCurrentAgent().getFilePath()+".pdf", "CurrentDocument");
} catch (NotesException e) {
e.printStackTrace();
}
}
public static boolean createPDF(String docPath, String pdfPath) {
try {
// start Lotus Notes
NotesThread.sinitThread();
System.out.println("Connecting to " + SERVER);
Session session = NotesFactory.createSession(SERVER, "My Notes ID file");
System.out.println("Opening database");
Database db = session.getDatabase(null, DATABASE);
if (db == null) {
System.out.println("Database not found!");
return false;
}
// open the document
System.out.println("Determining document view");
Document doc = db.createDocument();
doc.openByUrl(docPath);
System.out.println("Generating PDF");
doc.renderToRTItem(pdfPath);
// save the document
doc.save();
doc.close();
System.out.println("Done!");
return true;
}
catch (NotesException e) {
e.printStackTrace();
def convert(document):
return document.toPDF()
Script
function convert(doc):
return doc.pdf
Script
function convert(filename) {
// ...
}
convert('Expenses.nsf')
void convertNotesDocumentToPDF(NotesDocument doc, String fileName) {
NotesDocument toConvert = doc;
// do some work
toConvert.convertToPDf(fileName);
}
Script
function createPDF(doc) {
var pdf = new PDDoc();
pdf.Open(doc);
pdf.Save(path, 0, 0);
pdf.Close();
}
public void convertToPdf(Document doc){}
public void createPDFfromLNDoc(doc, pdfPath) {
return true
}
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();
}
}
Script
function lotusToPdf(document, outputfile) {
// get file content from lotus notes document
var content = document.content;
// create pdf file
var pdffile = PdfFile(outputfile);
// write content to pdf file
pdffile.write(content);
pdffile.close();
}
public void convertNotesDocumentToPDFFile(String inFile, String outFile) {
NotesVersion version = NotesFactory.getNotesVersion();
if (version.equals(NotesVersion.NOTES_6) || version.equals(NotesVersion.NOTES_7)) {
NotesDocument doc = NotesDatabase.getDocumentByUNID(inFile, "");
if (doc != null) {
doc.convertToPDF(outFile);
}
}
}
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(
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description