benjohnde/play-pdf

PDF module for play 2.0

rezacol opened this issue · 1 comments

Sample program for pdf module is not working
2012-05-30 21:25:13,182 - [ERROR] - from application in play-akka.actor.actions-dispatcher-6
Creating document from template
org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 7; The element type "link" must be terminated by the matching end-tag "".
at org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:191) ~[core-renderer-R8.jar:na]
at org.xhtmlrenderer.resource.XMLResource.load(XMLResource.java:79) ~[core-renderer-R8.jar:na]
at util.pdf.PDF.toStream(PDF.java:98) [pdf_2.9.1-0.2.jar:0.2]
at util.pdf.PDF.toBytes(PDF.java:84) [pdf_2.9.1-0.2.jar:0.2]
at util.pdf.PDF.ok(PDF.java:78) [pdf_2.9.1-0.2.jar:0.2]

Hmm - just checked the sample again and it worked for me.
Did you modify anything?
As mentioned, the view has to be XHTML in order to be rendered as PDF.
In the example, document.scala.html is based upon main.scla.html, where in lines 8 and 9, you can see the tags are closed.