Hello,
I'm trying to create a PDF document with a image logo in the header. But I'm having some troubles, look my code:
<p:document xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://jboss.com/products/seam/pdf"> <f:facet name="header"> <p:font name="arial" size="8"> <p:header borderWidthBottom="1" borderColorBottom="gray" borderWidthTop="0" alignment="left"> <p:image indentationLeft="0" indentationRight="0" value="/img/logo.jpeg" /> <p:font style="bold" size="20">#{document.title}</p:font> </p:header> <p:footer borderWidthTop="0.5" borderColorTop="gray" borderWidthBottom="0" alignment="right" size="10"> #{globalParams['appname']} [<p:pageNumber />] </p:footer> </p:font> </f:facet> </p:document>
When I run this file, I get this error:
SEVERE: Error Rendering View ViewNews.xhtml java.lang.RuntimeException: java.lang.ClassCastException: Insertion of illegal Element: 34 at org.jboss.seam.pdf.ui.UIDocument.processHeaders(UIDocument.java:243) .... Caused by: java.lang.ClassCastException: Insertion of illegal Element: 34 at com.lowagie.text.Phrase.add(Unknown Source) at org.jboss.seam.pdf.ui.UIHeaderFooter.handleAdd(UIHeaderFooter.java:46) at org.jboss.seam.pdf.ui.ITextComponent.add(ITextComponent.java:54)