I’m using Flying Saucer library in order to convert a couple of html files to pdf and I reached a problem – it seems that the library was not able to render the base64 embedded images. Inspired by this post, I wrote an implementation of ReplacedElementFactory in order to implement this feature. It will replace only the base64 embedded images – all the other elements are going to be handled by the default factory.
You have to configure the renderer in order to use the factory:
ITextRenderer renderer = new ITextRenderer();
SharedContext sharedContext = renderer.getSharedContext();
renderer.getSharedContext().setReplacedElementFactory(
new ITextExtendedReplacedElementFactory(
sharedContext.getReplacedElementFactory(),
sharedContext.getDotsPerPixel()));