7 Replies Latest reply on Dec 12, 2007 10:59 AM by hager hager

    FOP and ITEXT

    hager hager Newbie

      Hello,
      I'm trying to convert a XHTML page to a PDF page using FOP.
      I didn't use itext because i have a formatted paragraph, when i use itext, the PDF page will contain HTML tags.
      when I use FOP, I have the correct render, but when I try to access to another page, it generate exception and all pages doesn't work.
      please help me, what this bug?
      thank you

        • 1. Re: FOP and ITEXT
          Norman Richards Master

          If you ask a specific question, you are more likely to get a helpful answer.

          • 2. Re: FOP and ITEXT
            hager hager Newbie

            Hi,
            I want a solution to render a formatted paragrah in a PDF page, this is what I have to do.
            I tried FOP and ITEXT, and this is what I saw :
            when i use FOP, i have the correct render BUT when I execute another page after calling FOP, I have a strange behaviour!!
            But when I use ITEXT, i have HTML tags rendered in a PDF page!

            • 3. Re: FOP and ITEXT
              Dustin Norlander Apprentice

              Haha, adding exclamation points really makes your problem clear.

              I use itext with this additional tag which converts html to pdf (works great):
              http://jira.jboss.com/jira/browse/JBSEAM-1552

              good luck,
              Dustin

              • 4. Re: FOP and ITEXT
                Norman Richards Master

                Thanks for reminding me of that issue. I took the ideas in that code and created a p:html tag a while back. I wanted to go back and address the styling of it, but I haven't had time yet. I've gone ahead and checked it in so people can play with it and give feedback. (or better yet, contribute code for it) Look at the "HTML Conversion" page in the itext example.

                Basically, it lets you do stuff like:

                <p:html value="#{myHTML}" />


                or even:

                <p:html><s:formattedText value="#{myWikiText}" /></p:html>




                • 5. Re: FOP and ITEXT
                  hager hager Newbie

                  Hi,
                  Big thanks for you.
                  I added uioutoutrichText.java to the package jboss-seam-pdf.jar
                  but when i try to execute my page, i have the following exception :


                  13:10:07,890 FATAL [application] JSF1004: Cannot instantiate component of type org.jboss.seam.pdf.ui.UIOutputRichText
                  13:10:07,906 ERROR [STDERR] 12 déc. 2007 13:10:07 com.sun.facelets.FaceletViewHandler handleRenderException
                  GRAVE: Error Rendering View[/ExportCourrierPDF.xhtml]
                  javax.faces.FacesException: Erreur dans lexpression: Object nommé org.jboss.seam.pdf.ui.UIOutputRichText ne peut tre trouvé.
                   at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:553)
                   at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:91)
                   at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:243)
                   at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:139)
                   at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                   at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
                   at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
                   at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                   at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                   at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
                   at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
                   at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
                   at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                   at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at com.fitnetapplication.resources.pdf.RendererFilter.doFilter(RendererFilter.java:79)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                   at java.lang.Thread.run(Thread.java:595)


                  How can I fix this?
                  thanks again for help me.

                  • 6. Re: FOP and ITEXT
                    Norman Richards Master

                    You'd probably need to update the two configuration files too. Why don't you try the version in CVS? Or, if you can wait just a bit for 2.0.1 CR1 (out today, I hope) you'll get it too.

                    • 7. Re: FOP and ITEXT
                      hager hager Newbie

                      It works for me :), i updated the two configuration files
                      thanks you again.