To set the useragent to the pdfrenderer works perfectly in eclipse:

...
FOUserAgent useragent = fopFactory.newFOUserAgent();
PDFRenderer pdfrenderer = new PDFRenderer();

pdfrenderer.setUserAgent(useragent);
useragent.setRendererOverride(pdfrenderer);
fop = fopFactory.newFop(MimeConstants.MIME_PDF, useragent, out);

...

But when I want to run it in the script-library of notes, the
the exception is thrown again.

I don't know why it doesn't work because I override the renderer and in the
RendererFactory.class in line 222 the userAgent is checked if a Renderer
is set manually...

if (rendMaker == null && userAgent.getRendererOverride() == null) {
        throw new UnsupportedOperationException(
        "Don't know how to handle \"" + outputFormat + "\" as an output format."
        + " Neither an FOEventHandler, nor a Renderer could be found"
        + " for this output format.");
}

Something wrong with my implementation / explanations?

tanks :)

Jeremias Maerki <[EMAIL PROTECTED]> wrote on 18.10.2006 23:14:47:

> That's a mean little detail I've also stumbled over. Just call
> pdfrenderer.setUserAgent(useragent) after instantiating the PDFRenderer.
>
> On 18.10.2006 14:43:24 Tobias.Soloschenko wrote:
> > Hello,
> >
> > my problem is that I'm running fop out of java-librarys out of lotus
> > notes.
> > I'm getting the Error:
> >
> > java.lang.UnsupportedOperationException: 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.
> >         at
> > org.apache.fop.render.RendererFactory.
> createFOEventHandler(RendererFactory.java:223)
> >         at org.apache.fop.fo.FOTreeBuilder.<init>(FOTreeBuilder.java:97)
> >         at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:146)
> >         at org.apache.fop.apps.Fop.<init>(Fop.java:81)
> >         at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:186)
> >         at
> > de.timetoact.ntopdf.PDFTranslator.convertFileToPDF(PDFTranslator.java:61)
> >         at
> > de.timetoact.ntopdf.PDFTranslator.convertFilesToPDF(PDFTranslator.java:88)
> >         at JavaAgent.NotesMain(JavaAgent.java:38)
> >         at lotus.domino.AgentBase.runNotes(Unknown Source)
> >         at lotus.domino.NotesThread.run(Unknown Source)
> >
> > I read a mail from the mailing list, that I have to put the fop packages
> > xmlgraphics-commons.jar, fop.jar in the same classpath, so that
> > the xmlgraphics classes can read the text files in META-INF/services
> > directory.
> > The problem I expect is that notes cant read those text files.
> > And Because of this I want to set the Renderer by my own.
> >
> > Is it possible to set the Renderer manually? I tried it like this:
> >
> > FOUserAgent useragent = fopFactory.newFOUserAgent();
> > PDFRenderer pdfrenderer = new PDFRenderer();
> > useragent.setRendererOverride(pdfrenderer);
> > fop = fopFactory.newFop(MimeConstants.MIME_PDF, useragent, out);
> >
> > That leads me to a NullPointerException.
> >
> > Now to my System-Enviroment.
> > I'm using that librarys on multiple notes systems
> >
> > notes R6.5.1 or greater
> > JVM 1.3 or greater
> > the current FOP Implementation i use is 0.92beta
> >
> > Before I tried to use 0.92beta, I used 0.20.5  and all worked fine for me.
> >
> > best regards
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to