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

Fix Blurry issue by forcing rebuild ObjectUrl in PageRenderContext #181

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

huytr1995
Copy link
Contributor

Description

Describe the change and its purpose. Include a ticket if applicable.

Reviewer Instructions

Anything a review needs to know about this PR to help them give better feedback. Are there specific questions you have? Are there areas you are unsure of? Does this come from or relate to another part of the codebase?

Testing Plan

Describe what you did to test the change.

Output / Screenshots

Before

What did it look like before?

After

What will it look like after merging?

A11y

How do keyboard navigation and screen readers work with this PR?

Copy link
Contributor

@pauls-ai2 pauls-ai2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the wrong direction. isScaleChanged is effectively scale !== DEFAULT_SCALE, except it never goes back.

@@ -185,6 +188,7 @@ async function buildPageObjectURL({
const viewport = pageProxy.getViewport({ scale: scale * zoomMultiplier * devicePixelRatio });
canvas.height = viewport.height;
canvas.width = viewport.width;
canvas.style.width = '100%'; //de-zoom canvas with style (maybe you can directly use CSS), reaching de-zoom of higher definition PDF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style is meaningless when the element isn't in the DOM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might try canvasContext.imageSmoothingEnabled = false;.

Another thing you could try is canvasContext.imageSmoothingQuality = 'high';.

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

Successfully merging this pull request may close these issues.

2 participants