I have an HTML document which I need to convert to PDF format. I have added iText XMLWorker library to my project and wrote this snippet:
OutputStream file = new FileOutputStream(new File("testing.pdf"));
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, file);
document.open();
InputStream is = new ByteArrayInputStream(docString.getBytes());
XMLWorkerHelper.getInstance().parseXHtml(writer, document, is);
document.close();
file.close();
But the problem is that I can't include neither Document nor PdfWriter. They are not included in the library and when I tried to add
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.PdfWriter;
no .text is found in the library added.
What is the problem? Is there any thing missing? Should I include something else?