1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #14055 from Snuffleupagus/PDF_TO_CSS_UNITS

Add `PDF_TO_CSS_UNITS` to the `PixelsPerInch`-structure
This commit is contained in:
Tim van der Meij 2021-09-22 22:24:51 +02:00 committed by GitHub
commit 5254676ef3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 22 deletions

View file

@ -29,7 +29,6 @@ const {
const { SimpleLinkService } = pdfjsViewer;
const WAITING_TIME = 100; // ms
const PDF_TO_CSS_UNITS = PixelsPerInch.CSS / PixelsPerInch.PDF;
const CMAP_URL = "/build/generic/web/cmaps/";
const CMAP_PACKED = true;
const STANDARD_FONT_DATA_URL = "/build/generic/web/standard_fonts/";
@ -656,7 +655,9 @@ var Driver = (function DriverClosure() {
ctx = this.canvas.getContext("2d", { alpha: false });
task.pdfDoc.getPage(task.pageNum).then(
function (page) {
var viewport = page.getViewport({ scale: PDF_TO_CSS_UNITS });
var viewport = page.getViewport({
scale: PixelsPerInch.PDF_TO_CSS_UNITS,
});
self.canvas.width = viewport.width;
self.canvas.height = viewport.height;
self._clearCanvas();