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

PDFDownloadLink not working using Next js #2754

Closed
zhangqhzz opened this issue May 17, 2024 · 2 comments
Closed

PDFDownloadLink not working using Next js #2754

zhangqhzz opened this issue May 17, 2024 · 2 comments

Comments

@zhangqhzz
Copy link

"@react-pdf/renderer": "^3.4.4"
"next": "14.2.1",
{myDocument && <PDFDownloadLink document={myDocument} fileName={project.company.jgmc + project.year + ".pdf"}>
{({ blob, url, loading, error }) => {
console.log("loading=" + loading)
return error ? error.toString() :
loading ? 'Loading...' : <>Pdf</>
}}
}

console:
loading=false
loading=true
web: The page keeps displaying "Loading..."
Click No Response

@antal-bukos
Copy link

I ran into this same problem and what I found weird is that it works without Text elements, but when using text loading is never set to false. Based on discussions on a different issue, it happens when using custom fonts in the text, it's caused by a dependency of react-pdf, this helped me #2675 (comment).

@zhangqhzz
Copy link
Author

zhangqhzz commented May 21, 2024 via email

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