react-to-pdf
react-to-pdf copied to clipboard
Page Orientation does not work in toPDF Hook
Firstly great package, thanks.
Using the hook the following does not work:
const { toPDF, targetRef: pdfTargetRef } = usePDF(
filename: 'fileName.pdf'
})
const downloadAsPdf = () => {
toPDF({
page: {
orientation: 'landscape'
}
})
}
The downloaded PDF is in portrait
The following does work:
const { toPDF, targetRef: pdfTargetRef } = usePDF({
page: {
orientation: 'landscape'
},
filename: 'fileName.pdf'
})
const downloadAsPdf = () => {
toPDF()
}