[xwiki-devs] XWIKI - Export PDF Not Working
Hi, When exporting the page into PDF displaying the following error. How can solve this issue..? org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file. at org.dom4j.io.SAXReader.read(SAXReader.java:482) at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyCSS(PdfExportImpl.java:332) at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyCSS(PdfExportImpl.java:293) at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportHtml(PdfExportImpl.java:202) at com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:225) at com.xpn.xwiki.web.ExportAction.exportPDFOrRTF(ExportAction.java:198) at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:61) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:189) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Nested exception: -- Prathap
Hi, I am having following code in xwiki page. In listing it showing "BBB", but when exporting it to PDF it showing "AAA" in the PDF. <div id="text"> AAA </div> <script> document.getElementById("text").innerHTML = "BBB"; </script> -- Prathap On Fri, Aug 22, 2008 at 11:07 AM, Prathap Pandian <[email protected]>wrote:
Hi,
When exporting the page into PDF displaying the following error.
How can solve this issue..?
org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file. at org.dom4j.io.SAXReader.read(SAXReader.java:482) at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyCSS(PdfExportImpl.java:332) at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyCSS(PdfExportImpl.java:293) at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportHtml(PdfExportImpl.java:202) at com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:225) at com.xpn.xwiki.web.ExportAction.exportPDFOrRTF(ExportAction.java:198) at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:61) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:189) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Nested exception:
-- Prathap
I don't think it is hopable to have the PDF renderer to actually execute scripts, or? paul Le 22-août-08 à 14:04, Prathap Pandian a écrit :
Hi,
I am having following code in xwiki page. In listing it showing "BBB", but when exporting it to PDF it showing "AAA" in the PDF.
<div id="text"> AAA </div> <script> document.getElementById("text").innerHTML = "BBB"; </script>
I don't think it is hopable to have the PDF renderer to actually execute scripts, or?
Right now, it's definitely not hopable. The PDF renderer renders the basic content of the page, not its velocity & groovy & javascript rendered version. Sorry for your use case Prathap. Guillaume
paul
Le 22-août-08 à 14:04, Prathap Pandian a écrit :
Hi,
I am having following code in xwiki page. In listing it showing "BBB", but when exporting it to PDF it showing "AAA" in the PDF.
<div id="text"> AAA </div> <script> document.getElementById("text").innerHTML = "BBB"; </script>
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://blog.xwiki.com/
Hi, On Aug 22, 2008, at 3:06 PM, Guillaume Lerouge wrote:
I don't think it is hopable to have the PDF renderer to actually execute scripts, or?
Right now, it's definitely not hopable. The PDF renderer renders the basic content of the page, not its velocity & groovy & javascript rendered version.
No this is not quite correct. The document is first rendered to HTML and then we transform the HTML to xslfo and then to PDF. So the rendering to HTML evaluate Velocity and Groovy scripts. However it's true that javascript is not evaluated since it's the browser which is the runtime and does the evaluation. We only export the generated HTML; it's not executed in a javascript engine. Thanks -Vincent
Sorry for your use case Prathap.
Guillaume
paul
Le 22-août-08 à 14:04, Prathap Pandian a écrit :
Hi,
I am having following code in xwiki page. In listing it showing "BBB", but when exporting it to PDF it showing "AAA" in the PDF.
<div id="text"> AAA </div> <script> document.getElementById("text").innerHTML = "BBB"; </script>
Hi, Thanks Now i am clear. -- Prathap On Sat, Aug 30, 2008 at 3:27 AM, Vincent Massol <[email protected]> wrote:
Hi,
On Aug 22, 2008, at 3:06 PM, Guillaume Lerouge wrote:
I don't think it is hopable to have the PDF renderer to actually execute scripts, or?
Right now, it's definitely not hopable. The PDF renderer renders the basic content of the page, not its velocity & groovy & javascript rendered version.
No this is not quite correct. The document is first rendered to HTML and then we transform the HTML to xslfo and then to PDF. So the rendering to HTML evaluate Velocity and Groovy scripts.
However it's true that javascript is not evaluated since it's the browser which is the runtime and does the evaluation. We only export the generated HTML; it's not executed in a javascript engine.
Thanks -Vincent
Sorry for your use case Prathap.
Guillaume
paul
Le 22-août-08 à 14:04, Prathap Pandian a écrit :
Hi,
I am having following code in xwiki page. In listing it showing "BBB", but when exporting it to PDF it showing "AAA" in the PDF.
<div id="text"> AAA </div> <script> document.getElementById("text").innerHTML = "BBB"; </script>
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (4)
-
Guillaume Lerouge -
Paul Libbrecht -
Prathap Pandian -
Vincent Massol