Closed pacomart closed 3 months ago
Same problem here. The introduction of this bug was pretty recent.
I rolledback to: "@react-pdf/pdfkit": "3.1.2", "@react-pdf/renderer": "3.3.4", "@react-pdf/textkit": "4.3.0",
and I don't have any errors anymore.
Using "pdfkit" v3.1.3 or "renderer" v3.3.5 re-introduces the bug, so I left it as 3.1.2 and 3.3.4. Also "textkit" v4.3.0 is needed because newer versions seem to break in "renderer" v3.3.4.
I tried to rollback to "@react-pdf/renderer": "3.3.4", 3.3.3 and 3.3.2 and fail too.
I tried to rollback to "@react-pdf/renderer": "3.3.4", 3.3.3 and 3.3.2 and fail too.
You can use renderer v3.3.4 if you also install versions v3.1.2 of pdfkit and v4.3.0 of textkit. It's necessary to manually install those child dependencies because otherwise it will install the most up-to-date version of those child dependencies and that won't work.
They problem was either introduced in pdfkit v3.1.3 or one of it's child dependencies
Temporary solution, till it is fixed: Add the following to your package.json
"overrides": {
"@react-pdf/renderer": {
"@react-pdf/pdfkit": "3.1.2"
}
}
then npm i
and the images are working as expected
Using the following versions still results in generated .pdf file (Images that have a base64 src) not being able to open in Adobe Acrobat. Chrome, Edge, FireFox opens without problems. Inspecting the file in Affinity Designer shows the inserted Images as grey squares.
"@react-pdf/pdfkit": "3.1.2", "@react-pdf/renderer": "3.3.4", "@react-pdf/textkit": "4.3.0",
@diegomura I found the error and opened a PR. It's very small please merge it quickly
I'm having the same problem using "@react-pdf/renderer": "3.1.9"
, still no solution for me. Updating the dependency to a newer version breaks stuff and is not possible for me at the moment
I was using Yarn "resolutions": { "**/@react-pdf/pdfkit": "3.0.2" }
it work for me able to work for png & jpg images
Same problem here. The introduction of this bug was pretty recent.
I rolledback to: "@react-pdf/pdfkit": "3.1.2", "@react-pdf/renderer": "3.3.4", "@react-pdf/textkit": "4.3.0",
and I don't have any errors anymore.
Using "pdfkit" v3.1.3 or "renderer" v3.3.5 re-introduces the bug, so I left it as 3.1.2 and 3.3.4. Also "textkit" v4.3.0 is needed because newer versions seem to break in "renderer" v3.3.4.
Rollback worked for me too, hopefully this will be solved in the future
Describe the bug The generated PDF file cannot be opened in Adobe Acrobat Reader or others pdf readers, displaying an error 110. This error occurs when inserting an image with src={Buffer}.
To Reproduce Render a react-pdf with an
and try to open with Adobe Acrobat Reader.
Expected behavior Open the PDF file in other applications
Desktop (please complete the following information):
Thank