I'm trying to transform a simple HTML page to XSL-FO, to feed into Apache FOP for PDF rendering. The steps are: HTML+CSS -> XHTML -> XSL-FO -> PDF.
I've used the java library CSSToXSLFO to transform XHTML to XSL-FO. This works, however it's incapable of handling embedded images.
Are there any tools to transform
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hello</title>
</head>
<body>
<h1 style="color: green">Hello world!</h1>
<img src="data:image/png;base64,iVBORw...=" />
</body>
</html>
into
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:block color="green">Hello world!</fo:block>
<fo:external-graphic src="url(data:image/png;base64,iVBORw...=)" content-height="scale-to-fit" content-width="scale-to-fit" scaling="uniform"/>
</fo:block>
</fo:flow>
?