You need to sign in to do that
Don't have an account?
Atrebor
How can I exclude a button on a VF page from displaying when printing??
I have a basic VF page, and on that page, I have a button to print the VF page:
Since this button is only on there to Print, how can I not show the button when printing? The button is still displaying during the print preview, and then upon printing/saving as PDF. I have to think there's some simple way to not display the button when printing, but I am not very advanced with VF.
<apex:form > <div align="center" draggable="false" > <apex:commandbutton id="print" value="Print Win Report" onclick="window.print();" /> </div>
Since this button is only on there to Print, how can I not show the button when printing? The button is still displaying during the print preview, and then upon printing/saving as PDF. I have to think there's some simple way to not display the button when printing, but I am not very advanced with VF.
A user posted similar question in the past https://developer.salesforce.com/forums/?id=9060G000000IBWvQAO
Try using below code in your vf page.
<apex:commandLink value="Print" onclick="window.print();"/>
Related: https://salesforce.stackexchange.com/questions/244903/hide-div-from-page-layout-after-print-button-click
If this information helps, please mark the answer as best.Thank you