mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Re-factor the CSS_PIXELS_PER_INCH
/PDF_PIXELS_PER_INCH
exports (PR 13991 follow-up)
For improved maintainability, since these constants are being exposed in the official API, this patch moves them into an Object instead.
This commit is contained in:
parent
bd51bbfd16
commit
0e54f568fb
7 changed files with 18 additions and 20 deletions
|
@ -15,7 +15,7 @@
|
|||
|
||||
import {
|
||||
AnnotationMode,
|
||||
PDF_PIXELS_PER_INCH,
|
||||
PixelsPerInch,
|
||||
RenderingCancelledException,
|
||||
shadow,
|
||||
} from "pdfjs-lib";
|
||||
|
@ -34,7 +34,7 @@ function composePage(
|
|||
const canvas = document.createElement("canvas");
|
||||
|
||||
// The size of the canvas in pixels for printing.
|
||||
const PRINT_UNITS = printResolution / PDF_PIXELS_PER_INCH;
|
||||
const PRINT_UNITS = printResolution / PixelsPerInch.PDF;
|
||||
canvas.width = Math.floor(size.width * PRINT_UNITS);
|
||||
canvas.height = Math.floor(size.height * PRINT_UNITS);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue