> > There seems to be two main ways of creating PDF from java - 1. via HTML to
> > PDF and 2. using an API (e.g. iText).
[quoted text clipped - 12 lines]
>
> Regards, Lothar
> One reason I was interested is in the existing web app the document is shown
> on the page for a preview (before the user confirms and a PDF is made) so we
> have the HTML to start with, as well as the CGI Powerbuilder where the PDF
> is generated from.
[...]
> Interested in what you say about Apache FOP; I've not read in depth yet, but
> have looked at XMLMill http://www.xmlmill.com/products/xmlmillforjava.html
[quoted text clipped - 3 lines]
> still basically HTML but split data (which is easy as we can export XML from
> the database). Did you use Apache FOP in a similar way?
Apache FOP uses a Formatted Object (FO) to create PDF, SVG or
other formats. FO is XML-based and is generally created out
of a XML containing the data and a XSL-file that contains the
rules how the data should be "transformed" to whatever you
want.
In your case, XML with XSL would be a quite good fitting solution,
because you "only" need two XSL-files for your preview/PDF-creation-
scenario. One XSL is used for creating the HTML-preview, the other
one is used for creating the FO-file used by Apache-FOP to create
PDF or other target-formats.
With iText you would need two different mechanisms to create
HTML on the one side and PDF on the other. So I think FOP
would be the better solution for you in this case.
Regards, Lothar

Signature
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!
RobM - 21 Aug 2004 13:43 GMT
> > One reason I was interested is in the existing web app the document is shown
> > on the page for a preview (before the user confirms and a PDF is made) so we
[quoted text clipped - 28 lines]
>
> Regards, Lothar
Cheers and thanks
Best regards to Zaphod
Rob.
Rob Martin - 25 Aug 2004 00:59 GMT
> > One reason I was interested is in the existing web app the document is shown
> > on the page for a preview (before the user confirms and a PDF is made) so we
[quoted text clipped - 28 lines]
>
> Regards, Lothar
Ahhh... Lothar... I thought I could use the existing HMTL amended to be XSL
like below - but seems I cant use HTML tags, the XSL has to have <fo ...>
tags instead. Have you found that learning curve OK? I've looking at
http://www.w3schools.com/xslfo/xslfo_intro.asp.
(Seems iText looks simpler now!)
Cheers
Rob
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
<th align="left">Price</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet