try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
HtmlWriter.getInstance(document, new FileOutputStream("images_wrong.html"));
HtmlWriter writer = HtmlWriter.getInstance(document, new FileOutputStream("images_right.html"));
writer.setImagepath("./");
// step 3: we open the document
document.open();
// step 4: