Any document rendered in browser with iframe (from BlobProvider or PDFViewer) is empty
See original GitHub issueOS: Mac OS 10.41.1
React-pdf version: 1.0.0-alpha.25
Description: None of the generated iFrames are filled with the output. This happens both in the render process in an Electron app (should be the same as a web environment), and on codesandbox with the same behaviour (can be seen in sandbox, url below).
When generating a download link the resulting PDF is generated correctly, but in the case of iFrames they seem to be empty:
Codesandbox example: https://codesandbox.io/s/nk6k26x2rj
This is an issue since I imagine that if we want to do something like in the REPL where you can edit the pdf on the fly you need to show it in an iFrame, in order to maintain the aspect ratio, layout etc which should be fixed to the PDF, and not to the viewport. Rendering the <Document />
component in the virtual react DOM works in fact, but I’m not sure how to keep the generated content “independent” from the parent (e.g. fonts are inherited from the global css of the app, which is not something I want, etc.).
NOTE: just saw that this issue https://github.com/diegomura/react-pdf/issues/390 mentions that you have to wrap the <Document />
in another component that will render it properly, so what I described just above isn’t an option anyway 😅
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
Hey, https://codesandbox.io/s/nk6k26x2rj works with Firefox but not with Chromium…
Firefox :
Chromium :
This lib reported several issues running on codesandbox (unfortunately), and I think this might be it. I’m closing this, unless until I’m proved wrong to be it 😄