final ITextRenderer renderer = new ITextRenderer();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(f);
BufferedOutputStream bos = new BufferedOutputStream(fos);
renderer.setDocument(doc, null, new XhtmlNamespaceHandler());
ITextFontResolver resolver = renderer.getFontResolver();
// TODO: encoding is hard-coded as IDENTITY_H; maybe give user option to override
resolver.addFont(
fontPathTF.getText(),
BaseFont.IDENTITY_H,