Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Orientation does not work in toPDF Hook #116

Open
fsuk opened this issue Feb 23, 2024 · 1 comment
Open

Page Orientation does not work in toPDF Hook #116

fsuk opened this issue Feb 23, 2024 · 1 comment

Comments

@fsuk
Copy link

fsuk commented Feb 23, 2024

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

@mouchegmouradian
Copy link

Same here, any updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants