@SuppressWarnings("deprecation") public void HtmlToPdf(String source) { StyleSheet styles=null; try { List<Element> elements = (List<Element>) HTMLWorker.parseToList(new FileReader(source), styles); for (Element el : elements) { outDoc.add(el); } File wx=new File(source); wx.delete(); } catch (IOException | DocumentException ex) { SbApp.error("ExportPDF.HtmlToPdf("+source+")", ex); } }