In my lightning component, I have a div with aura:id = "hidefromPDF"
.
On Print button click I want to hide the div from page print.
I tried the following code on button click
{
var hidefromPDF = component.find('hidefromPDF');
$A.util.addClass(hidefromPDF,'slds-hide');
window.print();
$A.util.removeClass(hidefromPDF,'slds-hide');
}
But it's not hiding the div from the page print. Do I missing something here?