Skip to content
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

PDF is blurry #14147

Open
ilbalta opened this issue Oct 15, 2021 · 12 comments · May be fixed by #19128
Open

PDF is blurry #14147

ilbalta opened this issue Oct 15, 2021 · 12 comments · May be fixed by #19128

Comments

@ilbalta
Copy link

ilbalta commented Oct 15, 2021

Attach (recommended) or Link to PDF file here:
en_110.pdf

Configuration:

  • Web browser and its version: 93.0 (64-bit)
  • Operating system and its version: Windows 10 Pro build 19043.1266
  • PDF.js version: I am unsure how to check it
  • Is a browser extension: No?

Steps to reproduce the problem:

  1. Open the file
  2. Notice the text is blurry and uncomfortable to read

What is the expected behavior? (add screenshot)
In the image you can see the result of opening the same file at a similar zoom level on Firefox (left) and Edge (right)
image

What went wrong? (add screenshot)

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@ria-19

This comment has been minimized.

@ilbalta
Copy link
Author

ilbalta commented Oct 27, 2021

Hi, sorry for the late reply. I am unsure if that's for me to decide. The issue is still very much present on my end.

@marco-c
Copy link
Contributor

marco-c commented Jul 12, 2022

The problem in the PDF here and #14724 is that the PDFs are very large and so we render them using CSS zoom.

@marco-c marco-c changed the title PDF is blurry when opened in Firefox PDF is blurry Jul 12, 2022
@nwang-highspot
Copy link

Hi @marco-c, is there any plan to fix this probelm. Or is there any workaround?

@julian-eckhardt
Copy link

Hi there, I'm sorry to drag up this old issue once again. But I'd really need to render some PDFs with rather large page sizes as in #14724 (closed as duplicate of this issue).

Did anyone find a workaround for the problem?

On a side note: I suspect the CSS zoom is somehow also messing with centering the search results when the page is too large - perhaps it's scaling is ever-so-slightly different? Any thoughts on that?

@mmortal03
Copy link

@julian-eckhardt , that's crazy that they haven't fixed this yet. At least as a workaround for printing certain PDFs so that they weren't blurry, I started having the PDFs automatically open in an external viewer (SumatraPDF) -- but using an external viewer really isn't a useful workaround when you want to view PDFs directly in Firefox, have multiple tabs open, and have it remember the viewing position.

@calixteman
Copy link
Contributor

@julian-eckhardt , that's crazy that they haven't fixed this yet. At least as a workaround for printing certain PDFs so that they weren't blurry, I started having the PDFs automatically open in an external viewer (SumatraPDF) -- but using an external viewer really isn't a useful workaround when you want to view PDFs directly in Firefox, have multiple tabs open, and have it remember the viewing position.

If we're too slow for you, please feel free to write a patch, make a PR and we'll review it, instead of complaining.
If it's something very important for you, you can pay someone to write a patch.
Just for the reminder, pdf.js is a free product, some people here are working for free on their spare time and so really if you're unhappy with us, feel free to use an other product.

@mmortal03
Copy link

I very much appreciate free software, definitely not complaining -- just surprised that it's still an issue.

@Johnrobmiller

This comment was marked as off-topic.

@Johnrobmiller
Copy link

Getting back on topic, here's what fixed it for me (note, it might not fix it for you)

I increased the scale here from "1" to "3".
const viewport = pdfPage.getViewport({ scale: 3 })

When I looked at the viewport dimentions, I noticed that they were very small (like 250x500 pixels)
By increasing the scale, the resolution of the image went up

@julian-eckhardt

This comment was marked as off-topic.

@mmortal03
Copy link

mmortal03 commented Apr 28, 2023

Getting back on topic, here's what fixed it for me (note, it might not fix it for you)

I increased the scale here from "1" to "3". const viewport = pdfPage.getViewport({ scale: 3 })

When I looked at the viewport dimentions, I noticed that they were very small (like 250x500 pixels) By increasing the scale, the resolution of the image went up

Is it possible to modify whatever that scale parameter's default value is in pdf.js, as used in Firefox? I get that you're setting the viewport variable to the output of that function, but how would someone go about modifying the viewport variable so that it would practically apply to viewing the PDF from the OP in Firefox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants