i am converting html document to pdf using htmlworker (itext library )as follow
String path = "temp.pdf";
PdfWriter pdfWriter = null;
// create a new document
Document document = new Document();
pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(
path));
document.open();
HTMLWorker htmlWorker = new HTMLWorker(document);
String str = "";
StringBuilder contentBuilder = new StringBuilder();
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader("temp1.html"));
while ((str = in.readLine()) != null) {
contentBuilder.append(str);
}
} catch (IOException e) {
System.out.print("HTML file close problem:" + e.getMessage());
} finally {
in.close();
}
String content = contentBuilder.toString();
htmlWorker.parse(new StringReader(content));
document.close();
now my question is i am able to convert html to pdf using above code. but if my html page contain table tag it will create td with same size. how can i set width of td tag in generated pdf? thanks in advance