Here is a sample of code that is generation QR Code but unable to print.
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>QR Code</title>
</h:head>
<h:form>
<h:panelGrid>
<p:commandButton value="Print QR">
<p:printer target="qrCodeElem"/>
</p:commandButton>
<p:commandButton value="Print QR Panel">
<p:printer target="qrPanelId"/>
</p:commandButton>
<p:commandButton value="Print Hello">
<p:printer target="helloId"/>
</p:commandButton>
<p:panel id="qrPanelId">
<pe:qrCode id="qrCodeElem"
renderMethod="canvas"
text="someqrcode"
label="qrCodeLabel"
size="200"/>
</p:panel>
</h:panelGrid>
<p:panel id="helloId">
<h:outputText value="hello "/>
</p:panel>
</h:form>
</html>