Hi
Require help.
I have written a Java code in lotus notes using itext which will generate a PDF file. I want the full lotus notes document (text, richtext, images,etc) to be moved/exported/printed to PDF file using a program or code. In other words move the lotus notes documents directly to PDF at one stretch.
Appreciate a response and support at the earliest… Thanks..
appended is the code which have written
———————————————————————————————————————————————————————–
import lotus.domino.*;
import java.io.FileOutputStream;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Chapter;
import com.lowagie.text.Font;
import com.lowagie.text.List;
import com.lowagie.text.Table;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfWriter;
import lotus.domino.RichTextItem;
import com.lowagie.text.Image;
public class JavaAgent extends AgentBase {
public void NotesMain() {<br/>
try {<br/>
Session session = getSession();<br/>
AgentContext agentContext = session.getAgentContext();<br/>
//create document's object<br/>
<br/>
Document document = new Document();<br/>
try {<br/>
//create a document
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("c:\\PDFInlotus1.pdf"));<br/>
document.addAuthor("Santhosh"); <br/>
document.addSubject("Testing files."); <br/>
//open doc for r/w<br/>
<br/>
document.open();<br/>
DocumentCollection dc = agentContext.getUnprocessedDocuments();<br/>
lotus.domino.Document doc = dc.getFirstDocument();<br/>
// adding content to the document
document.add(new Paragraph(doc.getItemValueString("Text")));<br/>
//adding richtext field<br/>
document.add(new Paragraph (doc.getItemValueString("Additional_richText"))); <br/>
// adding the full notes document - need help here<br/>
document.add(doc);<br/>
<br/>
// To insert image
Image imgLogoImage = Image.getInstance("c:/image.jpg");<br/>
document.add(imgLogoImage);<br/>
<br/>
doc = dc.getNextDocument(); }<br/>
<br/>
catch (DocumentException de) {<br/>
System.err.println(de.getMessage());<br/>
}<br/>
document.close();<br/>
} catch(Exception e) {<br/>
e.printStackTrace();<br/>
}<br/>
}<br/>
}
———————————————————————————————————————————————————————–