Just a simple HTML -> PDF batch conversion

Just need what code fragment necessary to control Acrobat 6 and take multiple .html files and convert/save the PDFs.I just can’t figure out the classes and how to run Acrobat 6 (Standard).

TIA,

Collin

Subject: Just a simple HTML → PDF batch conversion

Have a look at iText

Subject: RE: Just a simple HTML → PDF batch conversion

May a little assistance for a Java rookie? :slight_smile:

It won’t compile when I uncomment the first “Document” line.

javaAgent.java:7: interface lotus.domino.Document is an inteface. it can’ be instantiated.

Here’s the agent fragment:

import lotus.domino.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {



	Document document = new Document();

	

	try {

		Session session = getSession();

		AgentContext agentContext = session.getAgentContext();



	//	PdfWriter.getInstance(document, new FileOutputStream("Chap0101.pdf"));

	//	document.open();



	//	document.close();



	} catch(Exception e) {

		e.printStackTrace();

	}

}

}

Subject: RE: Just a simple HTML → PDF batch conversion

Same deal as LotusScript, Collin – a document needs a parent database context, so you need to use:

Document document = db.createDocument();

Obviously, this means you’ll need to have gotten a handle on the session and database BEFORE trying to create the document. When done, it will be inside the main try{} block.

Subject: Getting closer … :slight_smile: Your tolerance is greatly appreciated

Looks like things are established for the process up to the PdfWriter instance.What’s the method for inserting the class for PdfWriter?

Session ses = getSession();

AgentContext ac = ses.getAgentContext();

Database db = ac.getCurrentDatabase();

Document doc = db.createDocument();

//PdfWriter.getInstance(document, new FileOutputStream(“Chap0101.pdf”));

//doc.open();

//doc.add(new Paragraph(“Hello World”));

//doc.close();