I am ready to convert xhtml files to pdf / format or pdf files to pdf / a format. Can someone suggest some java library that I can use. thank you
I will make my example more specific
I have a simple html file xyz.html
<html><body> hello <br> <font style = "Helvetica">hello</font> <br> </body></html>
java code:
Document document = new Document(PageSize.A4); FileOutputStream fout = new FileOutputStream(pdffile); PdfWriter pdfWriter = PdfWriter.getInstance(document, fout); pdfWriter.setPDFXConformance(PdfWriter.PDFA1B); FileReader fr = new FileReader(xyz.html); document.open(); HashMap<String, Object> Provider = new HashMap<String, Object>(); DefaultFontProvider def = new Provider.put(HTMLWorker.FONT_PROVIDER, def); HTMLWorker htmlWorker = new HTMLWorker(document); htmlWorker.setProviders(Provider); htmlWorker.parse(fr);
I get the error com.itextpdf.text.pdf.PdfXConformanceException: all fonts must be embedded. This is not: Helvetica
source share