You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by De Vleeschauwer Nele <Ne...@nbb.be> on 2006/05/10 10:13:36 UTC
Can not handle application/pdf format
Hi
For the moment I'm trying out the fop-0.92 beta release.
When I try to convert XML to PDF, I always receive the following
message:
"Don't know how to handle "application/pdf" as an output format. Neither
an FOEventHandler nor a Renderer could be found for this output format"
I use the following code:
OutputStream out = new java.io.FileOutputStream(pdfFile);
out = new java.io.BufferedOutputStream(out);
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
out);
Source xsl = createSourceObject(xslStylesheet);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(xsl);
Source src = createSourceObject(xmlInstance);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
What am I doing wrong here ?
Kind regards,
Nele De Vleeschauwer.
-----------------------------------------
Visit our website! http://www.nbb.be
"DISCLAIMER: The content of this e-mail message should not be
construed as binding on the part of the National Bank of Belgium
(NBB) unless otherwise and previously stated. The opinions
expressed in this message are solely those of the author and do not
necessarily reflect NBB viewpoints, particularly when the content
of this message, or part thereof, is private by nature or does not
fall within the professional scope of its author."
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Can not handle application/pdf format
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Are you running this in an application server of some kind? If yes, in
which?
If this happens, it means that there's something weird with the class
loader setup because the Service class in xmlgraphics-commons.jar cannot
find the text files in fop.jar under the META-INF/services directory.
Please make sure that fop.jar and xmlgraphics-commmons.jar are in the
same place if you've deployed this in an application server, so that
both JARs end up in the same class loader.
If the above doesn't help please tell us a little more about the
environment you're running FOP in: directory structure, app server name
and version etc.
On 10.05.2006 10:13:36 De Vleeschauwer Nele wrote:
> Hi
>
> For the moment I'm trying out the fop-0.92 beta release.
>
> When I try to convert XML to PDF, I always receive the following
> message:
>
> "Don't know how to handle "application/pdf" as an output format. Neither
> an FOEventHandler nor a Renderer could be found for this output format"
>
> I use the following code:
>
> OutputStream out = new java.io.FileOutputStream(pdfFile);
> out = new java.io.BufferedOutputStream(out);
>
> FopFactory fopFactory = FopFactory.newInstance();
> FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
> Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
> out);
>
> Source xsl = createSourceObject(xslStylesheet);
>
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transformer = factory.newTransformer(xsl);
>
> Source src = createSourceObject(xmlInstance);
>
> Result res = new SAXResult(fop.getDefaultHandler());
>
> transformer.transform(src, res);
>
>
>
> What am I doing wrong here ?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org