I am using ULtimate PDF for the preview PDF. the code i use "window.print();" for my print and the problem is when i'm clicking the print button. the download and print button is joining to the print. is there a way i can hide the print and download button when im printing the actual pdf? thank you
Hello,
You can hide elements from your page when in print mode using CSS media queries. For instance, adding this CSS to your theme will hide all elements with the "btn" class when printing the page:
@media print { .btn { visibility: hidden; }}
it actually worked it is hidden but the page is still giving extra
Giving extra what?
Hi @budang haba ,
You can try using the HideOnPrint block available in the UltimatePDF module.
The element defined inside the HideOnPrint block's content placeholder will not be visible on print media.
Hope this will help you!
hi! how can i use this?
Hi,
You can simply drag and drop the web block on your screen and place the content that you want to hide while printing the pdf. In your case, the print button
this does not work,,
If possible can you please attach the oml file here.
have you tried printing your example? because for me it doesnt work for me
Please use PrintLayout from ultimate pdf module, and place the hideOnPrint inside it. It should work for you
Please check attached oml file
Thank You ... its Working..
hi @budang haba
put thoes button in container and give it name and use this javascript to hide this container
let get = document.getElementById(container id); // pass the id by input of the javascript
get.style.visibility = 'hidden';
after that call the window.print() function.
definitely it will work. hope this helps
Thanks
Prince
i tried this but does not work
try this javascript or try to attach oml i will look into
ive tried this but still wont work tho
could you please share the OML?
cant share it due to intellectual property