You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Raimund Kammering <Ra...@desy.de> on 2002/02/25 10:35:17 UTC
Including html pages
Hi,
I want to dynamically include an html page into a pdf document.
The process is as follows:
A java servlet concatenates a number of xml files controlled
by one xsl file.
Now I also want to include an html file into this procedure.
How can this be done?
After all processing of the xml/html files another java servlet
does the transformation to pdf, directly rendering the data
to the browser.
Including the html for processing via xml/xsl to html is clear - but
I have no idea how to do this for the fop transformations (fo:external
graphics seems not to be the right way?).
Any ideas are welcome.
Raimund
--
DESY -MVP-
Notkestrasse 85
D-22603 Hamburg
Tel.: +49 40 8998 -4903
e-mail: Raimund.Kammering@desy.de
Re: Including html pages
Posted by alex <al...@yahoo.com>.
At 09:35 25/02/2002, Raimund Kammering wrote:
>Hi,
>
>I want to dynamically include an html page into a pdf document.
>The process is as follows:
> A java servlet concatenates a number of xml files controlled
> by one xsl file.
>
> Now I also want to include an html file into this procedure.
> How can this be done?
Aha - you are after the Holy Grail of FOP and XSL:FO
OK...
FOP converts XSL:FO (plus SVG images, plus bitmap graphics) into PDF (and
other formats).
If you want to include HTML then we have to turn it into one of these formats.
You have already considered bitmaps and wisely rejected that idea.
I don't think there is an HTML->SVG converter but it *might* be a way to go.
Most people think of (and then have problems with) the idea of converting
HTML to XSL:FO via XHTML.
Because XHTML is valid XML it can be processed with XSLT.
So for instance we might attempt to take the html, use Tidy on it to
convert it to valid XHTML,
and then use Antenna's XSLT for converting XHTML to XSL:FO
The problem with this is that it is a lot of work, and Antenna's XSLT does
not work with FOP (in my experience) only their own XSL:FO engine.
Which brings me to the conclusion which most people reach - there is no
generic way of converting web pages into PDF using FOP. Most people end up
deciding to convert the source material into XML instead of leaving it as html.
Now if you had a web browser which saved the displayed screen as SVG or PDF
then we might have a chance....
(If you are still interested Tidy can be found on SourceForge and you can
find the XHTML->XSL:FO stuff on Antenna's site)
<plug>
PS I am offering free consultancy to London firms. This includes FOP. Check
out http://www.OWAL.co.uk/
</plug>
<apology repeat="as often as necessary">
My FOP FAQ has been down since I moved machines. Sorry. I'm going to try
turning it into xdocs format so it can be stored in the CVS and delivered
with FOP.
</apology>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org