1 Reply Latest reply on Nov 2, 2010 6:47 PM by Robert Morse

    Seam PDF & p:image

    ginni machamer Newbie

      Hi,


      I need to dynamically display an image based on a bean attribute value within a PDF I am producing with Seam PDF.  However, I see that the p:image tag does not have a rendered property as the h:graphicImage does.  How can I accomplish the same effect in the PDF?


      Thanks!


      Ginni

        • 1. Re: Seam PDF & p:image
          Robert Morse Apprentice

          Embed the image within another component like p:table.




          <p:table borderWidth="0" columns="2" widths="1 1" rendered="#{yourBeanHere}">
             <p:cell borderWidth="0">
                <p:image value="yourImageHere" />
             </p:cell>
             <p:cell/>
          </p:table>



          I use the column widths to adjust the size of the rendered image.  The p:image value can reference some bean that contains the image data if you're loading from a database for example.   There are probably other ways to do this, but I found this works well.