4

I have generated a qr code for my application using this code.

<p:dataTable var="ud" value="#{userdata.list}" id="dataset">
    <p:column headerText="Transection Id">
        <h:outputText value="#{ud.num}" />
    </p:column>

    <p:column headerText="Number">
        <h:outputText value="#{ud.number}" />
    </p:column>

    <p:column headerText="Amount">
        <h:outputText value="#{ud.amount}" />
    </p:column>

    <p:column headerText="Type">
        <h:outputText value="#{ud.type}" />
    </p:column>

    <p:column headerText="Date">
        <h:outputText value="#{ud.date}" />
    </p:column>

    <p:column headerText="Qr Code">     <!-------------Here-->
        <p:barcode value="0123456789" type="qr"/>
    </p:column>
</p:dataTable>

This works fine & I am able to generate a data table which contains data as columns as QR code in one column. Data tABLE

Now I have added data exporter tag to generate PDF.

<h:commandLink>
    <p:graphicImage name="/demo/images/xml.png" />
    <p:dataExporter type="pdf" target="dataset" fileName="file" pageOnly="true" />
</h:commandLink>

I am able to generate the PDF file but the QR code is not being printed into the PDF file while rest of the detail are displayed.

PDF file

pdf file

I have seen an example to add image into the PDF using PrimeFaces but in that case I need to give the path of the image file so is there any way by which i can display the PDF?

Tiny
  • 27,221
  • 105
  • 339
  • 599
Ankit Sharma
  • 147
  • 1
  • 9
  • 1
    You might be able to use a workaround similar to the one described here: http://stackoverflow.com/a/14413932/271047 – MatsT May 04 '15 at 14:35

0 Answers0