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:
Jonas Jenwald 2021-09-11 11:11:32 +02:00
parent bd51bbfd16
commit 0e54f568fb
7 changed files with 18 additions and 20 deletions

View file

@ -32,8 +32,10 @@ import {
const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
const SVG_NS = "http://www.w3.org/2000/svg";
const CSS_PIXELS_PER_INCH = 96.0;
const PDF_PIXELS_PER_INCH = 72.0;
const PixelsPerInch = {
CSS: 96.0,
PDF: 72.0,
};
class DOMCanvasFactory extends BaseCanvasFactory {
constructor({ ownerDocument = globalThis.document } = {}) {
@ -625,7 +627,6 @@ function getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {
export {
addLinkAttributes,
CSS_PIXELS_PER_INCH,
DEFAULT_LINK_REL,
deprecated,
DOMCanvasFactory,
@ -641,8 +642,8 @@ export {
LinkTarget,
loadScript,
PageViewport,
PDF_PIXELS_PER_INCH,
PDFDateString,
PixelsPerInch,
RenderingCancelledException,
StatTimer,
};