Print
#2432
Replies: 1 comment
-
hi @irfan1452 i think you could try something like this maybe but i think you might still need to click the print button on the new window; import { usePDF } from '@react-pdf/renderer'
const MyComponent = () => {
const [instance, updateInstance] = usePDF({
document: <MyDocument />,
})
const handlePrint = () => {
if (instance.url) {
const newWindow = window.open(instance.url, '_blank', 'noopener,noreferrer')
if (newWindow) newWindow.print()
}
}
return <button onClick={handlePrint}>Print</button>
} |
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
-
How to Print the Document Without Viewing it in PDFViewer
I want when i click on the Print Button The Document Should sent to the Browser Print Dialog
Is it Possible?
Or How can I Fire Print Button Programmatically?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions