I am new in iText, I want to convert HTML string to Pdf in Itext. I found lots of example on the Internet. Then I found one example and want to implement same here, but not able to implement the example in my project. I added dependencies in my pom.XML file .
Here is the link :
https://developers.itextpdf.com/examples/xml-worker-itext5/basic-html-examples
Pom.xml
<!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.0.6</version>
</dependency>
**<!-- https://mvnrepository.com/artifact/com.itextpdf.tool/xmlworker -->
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.4.1</version>
</dependency>**
Code snippet:
PdfPTable table = new PdfPTable(1);
PdfPCell cell = new PdfPCell();
ElementList list =XMLWorkerHelper.parseToElementList(encountersoapnotes.getHpi(), null);
for (Element element : list) {
cell.addElement(element);
}
table.addCell(cell);
document.add(table);
The above parseToElementList(str,null)
method is not available after installing maven command.
Anyone give me the maven dependency for this XMLWorkerHelper class which contains parseToElementList(str,null)
method.
Thanks Sitansu