Skip to content

Commit 1dbd58c

Browse files
authored
Merge pull request #371 from OneNoteDev/bug/pdf-render-quality-fix
Fix the PDF rendering quality
2 parents cdf25b0 + 06c07ac commit 1dbd58c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/scripts/contentCapture/pdfJsDocument.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ export class PdfJsDocument implements PdfDocument {
4848
return new Promise<string>((resolve) => {
4949
// In pdf.js, indexes start at 1
5050
this.pdf.getPage(pageIndex + 1).then((page) => {
51-
let viewport = page.getViewport(1 /* scale */);
51+
// Issue #369: When the scale is set to 1, we end up with poor quality images
52+
// on high resolution machines. The best explanation I found for this was in
53+
// this article: http://stackoverflow.com/questions/35400722/pdf-image-quality-is-bad-using-pdf-js
54+
// Note that we played around with setting the scale from 3-5, which looked better on high
55+
// resolution monitors - but did not look good at all at lower resolutions. scale=2 seems
56+
// to be the happy medium.
57+
let viewport = page.getViewport(2 /* scale */);
5258
let canvas = document.createElement("canvas") as HTMLCanvasElement;
5359
let context = canvas.getContext("2d");
5460
canvas.height = viewport.height;

0 commit comments

Comments
 (0)