You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Embedded image disappears when zooming or scrolling the PDF in Apple Preview
#3428
Several users (myself included) are experiencing a rendering issue where a full-page embedded image initially appears in a generated PDF, but disappears as soon as you zoom or scroll when viewing in Apple Preview (macOS) or the Files app (iOS).
This was previously reported in issue #2397, but was closed as "not an issue of this lib." However, there is strong evidence that something in react-pdf's PDF output triggers this bug — the same image embedded via pdfkit or Figma does not exhibit the problem.
Reproduction
A minimal reproduction is available in the react-pdf REPL.
Screen.Recording.2026-05-20.at.9.55.21.AM.mov
Steps to reproduce:
Open the REPL link above
Download the generated PDF on macOS or iOS
Open it in Apple Preview (macOS) or Files app (iOS)
Workaround found: Adding marginHorizontal: 1 to the <Image> prevents the issue. This suggests the problem may be related to how the image bounding box is written into the PDF when horizontal padding/margin is zero.
Key observations
Only occurs with images that are close to full page size
Particularly triggered when the image contains rasterized text (pixels that look like text, which Apple's text-recognition may try to process)
Setting paddingHorizontal: 0 on the parent <View> reliably triggers the bug
The same image embedded via pdfkit or Figma does not cause this issue
The PDF opens fine in Adobe Reader
Environment
OS: macOS Tahoe 26.5
react-pdf version: v4.x
Viewer: Apple Preview
Why this warrants further investigation
While Apple Preview may have quirks, the fact that the same image via pdfkit produces a correct PDF strongly suggests react-pdf is generating subtly non-standard PDF output (e.g. image stream dimensions, bounding box, or XObject definitions) that triggers an Apple renderer edge case. A comparison of the raw PDF structure between a react-pdf output and a pdfkit output for the same image could help pinpoint the difference.
Happy to help test fixes or provide more reproduction cases.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Overview
Several users (myself included) are experiencing a rendering issue where a full-page embedded image initially appears in a generated PDF, but disappears as soon as you zoom or scroll when viewing in Apple Preview (macOS) or the Files app (iOS).
This was previously reported in issue #2397, but was closed as "not an issue of this lib." However, there is strong evidence that something in react-pdf's PDF output triggers this bug — the same image embedded via pdfkit or Figma does not exhibit the problem.
Reproduction
A minimal reproduction is available in the react-pdf REPL.
Screen.Recording.2026-05-20.at.9.55.21.AM.mov
Steps to reproduce:
Minimal code snippet (from @mmoulton):
Workaround found: Adding
marginHorizontal: 1to the<Image>prevents the issue. This suggests the problem may be related to how the image bounding box is written into the PDF when horizontal padding/margin is zero.Key observations
paddingHorizontal: 0on the parent<View>reliably triggers the bugpdfkitor Figma does not cause this issueEnvironment
Why this warrants further investigation
While Apple Preview may have quirks, the fact that the same image via pdfkit produces a correct PDF strongly suggests react-pdf is generating subtly non-standard PDF output (e.g. image stream dimensions, bounding box, or XObject definitions) that triggers an Apple renderer edge case. A comparison of the raw PDF structure between a react-pdf output and a pdfkit output for the same image could help pinpoint the difference.
Happy to help test fixes or provide more reproduction cases.
Thanks for considering this!
All reactions