-
-
Notifications
You must be signed in to change notification settings - Fork 982
Description
Before you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
- If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
When rendering certain PDFs using react-pdf, text displays with inconsistent sizing on Android devices. Some text spans appear larger and more tightly-spaced than others, sometimes within the same line. The same PDFs render correctly and consistently on desktop browsers and iOS Safari, matching the original document appearance.
Steps to reproduce
- Download the attached PDF: Hansard Report - Wednesday, 5th November 2025 (A).pdf
- Open the PDF using react-pdf on an Android device (Chrome, Opera, Samsung Internet)
- Observe text rendering on, for example, page 21 of 48
- Compare with the same PDF rendered on desktop Chrome or iOS Safari
Minimal code to reproduce:
import { Document, Page, pdfjs } from "react-pdf";
import "react-pdf/dist/Page/AnnotationLayer.css";
import "react-pdf/dist/Page/TextLayer.css";
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
function PDFViewer() {
return (
<Document
file="path/to/document.pdf"
>
<Page
pageNumber={21}
renderTextLayer={true}
renderAnnotationLayer={true}
width={window.innerWidth < 768 ? window.innerWidth - 32 : 800}
scale={1}
/>
</Document>
);
}
Expected behavior
Text is expected to render with consistent sizing and spacing as it appears in the original PDF document and as it displays on desktop browsers and iOS Safari. The PDF renders correctly in Android's native PDF viewers and in the PDF.js demo viewer.
Desktop screenshot:
Actual behavior
On Android devices (tested on Chrome, Opera and Samsung Internet), text renders with size and spacing inconsistencies:
- Some text spans appear larger than others
- Text spacing becomes tighter in some spans
- These inconsistencies occur even within the same line of text
- The issue affects multiple pages throughout the document
- The problem only occurs with certain PDFs, not all PDFs
Android screenshot:
Additional information
No response
Environment
- Browser (if applicable): Chrome for Android, Opera for Android
- React-PDF version: 10.2.0
- React version: 19.1.1
- Bundler name and version (if applicable): Vite 7.1.7

