How to print the pdf on button click #2052
Sharanravindran
started this conversation in
General
Replies: 1 comment
-
Hi @Sharanravindran, if you are using PDFviewer and since its an iframe you could do something like below get the iframe element from the DOM const handlePrint = () => {
const iframe: HTMLIFrameElement = document.getElementsByTagName('iframe')[0]
iframe?.focus()
iframe?.contentWindow?.print()
} let me know how it goes, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi right now, the only ways to print the pdf is to either click on the print option in the PDFviewer toolbar, the other way is to right click on the pdf and select print.
But what I want, is to print the pdf with a click on a button, is this possible?
Please show solution with React
Beta Was this translation helpful? Give feedback.
All reactions