@progress/kendo-pdfviewer-common 1.0.0-develop.2 → 1.0.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/utils.js +9 -1
- package/dist/es2015/utils.js +9 -1
- package/dist/npm/utils.js +8 -0
- package/package.json +1 -1
package/dist/es/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { saveAs } from '@progress/kendo-file-saver';
|
|
2
2
|
import { detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
|
|
3
|
-
import { getDocument, TextLayer } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
3
|
+
import { getDocument, TextLayer, PixelsPerInch } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
4
4
|
import { LinkAnnotation } from './annotations';
|
|
5
5
|
import { createElement, scrollToPage } from './common/dom';
|
|
6
6
|
export { createElement, scrollToPage };
|
|
@@ -90,6 +90,10 @@ export const loadPDF = (options) => {
|
|
|
90
90
|
const params = getDocumentParameters(options);
|
|
91
91
|
const { dom, zoom, done, error, rootElement } = options;
|
|
92
92
|
const loadOnDemandPageSize = options.loadOnDemandPageSize || 2;
|
|
93
|
+
dom.style.setProperty('--scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
94
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
95
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
96
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
93
97
|
getDocument(params)
|
|
94
98
|
.promise.then((pdfDoc) => {
|
|
95
99
|
const pages = [];
|
|
@@ -131,6 +135,10 @@ export const reloadDocument = (params) => {
|
|
|
131
135
|
const { pdfDoc, zoom, dom, done, error, loadOnDemand, rootElement } = params;
|
|
132
136
|
const pages = [];
|
|
133
137
|
let currentPageIndex = 0;
|
|
138
|
+
dom.style.setProperty('--scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
139
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
140
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
141
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
134
142
|
// Save the index of the current page in view before we reload the document.
|
|
135
143
|
if (loadOnDemand && rootElement) {
|
|
136
144
|
currentPageIndex = currentPage(rootElement);
|
package/dist/es2015/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { saveAs } from '@progress/kendo-file-saver';
|
|
2
2
|
import { detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
|
|
3
|
-
import { getDocument, TextLayer } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
3
|
+
import { getDocument, TextLayer, PixelsPerInch } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
4
4
|
import { LinkAnnotation } from './annotations';
|
|
5
5
|
import { createElement, scrollToPage } from './common/dom';
|
|
6
6
|
export { createElement, scrollToPage };
|
|
@@ -90,6 +90,10 @@ export const loadPDF = (options) => {
|
|
|
90
90
|
const params = getDocumentParameters(options);
|
|
91
91
|
const { dom, zoom, done, error, rootElement } = options;
|
|
92
92
|
const loadOnDemandPageSize = options.loadOnDemandPageSize || 2;
|
|
93
|
+
dom.style.setProperty('--scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
94
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
95
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
96
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
93
97
|
getDocument(params)
|
|
94
98
|
.promise.then((pdfDoc) => {
|
|
95
99
|
const pages = [];
|
|
@@ -131,6 +135,10 @@ export const reloadDocument = (params) => {
|
|
|
131
135
|
const { pdfDoc, zoom, dom, done, error, loadOnDemand, rootElement } = params;
|
|
132
136
|
const pages = [];
|
|
133
137
|
let currentPageIndex = 0;
|
|
138
|
+
dom.style.setProperty('--scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
139
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
140
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
141
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
134
142
|
// Save the index of the current page in view before we reload the document.
|
|
135
143
|
if (loadOnDemand && rootElement) {
|
|
136
144
|
currentPageIndex = currentPage(rootElement);
|
package/dist/npm/utils.js
CHANGED
|
@@ -98,6 +98,10 @@ const loadPDF = (options) => {
|
|
|
98
98
|
const params = getDocumentParameters(options);
|
|
99
99
|
const { dom, zoom, done, error, rootElement } = options;
|
|
100
100
|
const loadOnDemandPageSize = options.loadOnDemandPageSize || 2;
|
|
101
|
+
dom.style.setProperty('--scale-factor', String(zoom * pdf_mjs_1.PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
102
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * pdf_mjs_1.PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
103
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
104
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
101
105
|
(0, pdf_mjs_1.getDocument)(params)
|
|
102
106
|
.promise.then((pdfDoc) => {
|
|
103
107
|
const pages = [];
|
|
@@ -140,6 +144,10 @@ const reloadDocument = (params) => {
|
|
|
140
144
|
const { pdfDoc, zoom, dom, done, error, loadOnDemand, rootElement } = params;
|
|
141
145
|
const pages = [];
|
|
142
146
|
let currentPageIndex = 0;
|
|
147
|
+
dom.style.setProperty('--scale-factor', String(zoom * pdf_mjs_1.PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
148
|
+
dom.style.setProperty('--total-scale-factor', String(zoom * pdf_mjs_1.PixelsPerInch.PDF_TO_CSS_UNITS));
|
|
149
|
+
dom.style.setProperty('--scale-round-x', '1px');
|
|
150
|
+
dom.style.setProperty('--scale-round-y', '1px');
|
|
143
151
|
// Save the index of the current page in view before we reload the document.
|
|
144
152
|
if (loadOnDemand && rootElement) {
|
|
145
153
|
currentPageIndex = (0, exports.currentPage)(rootElement);
|
package/package.json
CHANGED