ivmarcos/react-to-pdf

Page Orientation does not work in toPDF Hook

Opened this issue · 1 comments

fsuk commented

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()
  }

Same here, any updates on this ?