-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distorted text #1025
Comments
I am also facing the same problem |
I have the same problem with external pdf docs (Google Chrome). I use this versions deps:
This is my react component for use react-pdf: import React, { useState } from 'react';
import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
import { Box } from '@mui/material';
import './index.css';
const PDFViewer: React.FC<{ fileURL: string }> = ({ fileURL }) => {
const [numPages, setNumPages] = useState(null);
const onDocumentLoadSuccess = (args: any) => {
setNumPages(args.numPages);
};
return (
<Document
className="document-pdf"
file={fileURL}
onLoadSuccess={onDocumentLoadSuccess}
>
{Array.from(new Array(numPages), (el, index) => (
<Box key={`page_${index + 1}`} marginBottom="10px">
<Page width={900} pageNumber={index + 1} />
</Box>
))}
</Document>
);
};
export default PDFViewer; |
We also faced the same issue in our app. However if we disable Accelerated 2D canvas in |
Looks like they found at least a temporary solution over on react-pdf/renderer.
This worked for me in react-pdf: 5.7.2, and my fonts all still look correct. |
This did help the text render correctly in my case, but then any images embedded in the pdf don't render. The images just show up as the standard 'image not found' image. |
Yeah this is the same for me...pretty funny tbh, like playing whack-a-mole with these settings. Free though so can't complain, going to investigate some paid options I guess! |
Can you still see this in v6? PDF.js got updated in v6 so chances are the issues you're experiencing have been resolved by now. |
I will test when I get a chance! However I am not sure this will be resolved...see here...i think this is the same issue and the pdf.js folks seem to just be not supporting chrome... |
I can confirm this is still an issue with v6.0.3 |
Problem exists in Chrome and Edge, but problem doesn't exist when using Firefox. |
I’ve been testing this issue on our fork of react-pdf and I get some pretty good results, at least preliminarily. The issue was only occurring on certain integrated GPUs. Namely Intel Iris Xe, Intel UHD, Nvidia T1200. The only change I made related to this is adding @wojtekmaj From the early testing results, this seems to fix the distorted text. Important to note that the pdfjs viewer does not have this issue and they also have |
mozilla/pdf.js#14641 (comment) Seems to be fixed by Chrome? |
Duplicate of #1010 |
There were certain browser / system configurations that caused issues. See: wojtekmaj/react-pdf#1010 wojtekmaj/react-pdf#1025 (comment)
There were certain browser / system configurations that caused issues. See: wojtekmaj/react-pdf#1010 wojtekmaj/react-pdf#1025 (comment) Co-authored-by: Marcel Ellermann <Marcel.Ellermann@netfira.com>
Before you start - checklist
Description
I am getting a pdf that is rendered incorrectly and looks like:
The actual pdf looks normal.
It is not one of the overlays causing the issue (text or annotation) and when toggling back and forth between single page and multi-page views the issue resolves. It also seems dependent on the resolution or appears on some machines and not others so it is a little tricky to repro.
Steps to reproduce
Difficult to consistently reproduce.
Expected behavior
Display pdf clearly
Actual behavior
Pdf is distorted
Additional information
No response
Environment
The text was updated successfully, but these errors were encountered: