Printer is used to print a certain component instead of the whole page.
<div class="card">
<p:commandButton value="Print" type="button" icon="pi pi-print" styleClass="shadow-1 mb-3 mr-2">
<p:printer target="image"/>
</p:commandButton>
<p:commandButton value="Print (custom configuration)" type="button" icon="pi pi-print" styleClass="shadow-1 mb-3">
<p:printer target="pnlPrint" configuration="globalStyles: true, title: 'Nature Image Header', timeout: 1000"/>
</p:commandButton>
<p:outputPanel id="pnlPrint">
<p:graphicImage id="image" name="demo/images/nature/nature10.jpg"/>
</p:outputPanel>
</div>