react-pdf
react-pdf copied to clipboard
Function renderToString not working with images
Describe the bug When we are using renderToString function, it does not work when we have images in the component. It means it did not render the images when we generate a pdf file. And some font errors appear.
To Reproduce Steps to reproduce the behavior including code snippet:
- We used renderToString function to generate a long string from the pdf component (contains image) on BE side.
- We used Blob to generate pdf file from the string received from BE. We used the code below:
import { saveAs } from "file-saver";
...
// data was received from BE
var blob = new Blob([data], { type: "application/pdf" });
saveAs(blob);
- It runs and downloaded a pdf file, but it shows error fonts and does not show images. (The images we used are both in the relative path and absolute path, the absolute path is a public image path, we can access anywhere on the internet).
Expected behavior We hope that it will show with no error fonts (correct font and format) and show images.
Some image to show issues

I'm having the same issue. Were you able to work around this somehow?
I'm also having this issue #1922 It also breaks the fonts.