@progress/kendo-pdfviewer-common 1.0.0-develop.3 → 1.0.0-develop.4
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 +7 -2
- package/dist/es2015/utils.js +7 -2
- package/dist/npm/utils.js +7 -2
- package/package.json +1 -1
package/dist/es/utils.js
CHANGED
|
@@ -258,8 +258,13 @@ export const renderPage = (page, emptyPage, error) => {
|
|
|
258
258
|
container: textLayer,
|
|
259
259
|
viewport: viewport
|
|
260
260
|
}).render().then(() => {
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
// Directly assign the pre-calculated pt dimensions.
|
|
262
|
+
// A px→pt text replacement leaves --total-scale-factor (= zoom * PDF_TO_CSS_UNITS,
|
|
263
|
+
// correct for CSS-px font sizes) multiplying CSS pt values, making the layer
|
|
264
|
+
// ~33% too wide. Assigning styles.width/height (= raw_page_width * zoom pt)
|
|
265
|
+
// keeps font-size calculations intact while matching the page element exactly.
|
|
266
|
+
textLayer.style.width = styles.width;
|
|
267
|
+
textLayer.style.height = styles.height;
|
|
263
268
|
const rotation = textLayer.getAttribute('data-main-rotation') || '0';
|
|
264
269
|
if (transforms[rotation]) {
|
|
265
270
|
textLayer.style.transform = transforms[rotation];
|
package/dist/es2015/utils.js
CHANGED
|
@@ -258,8 +258,13 @@ export const renderPage = (page, emptyPage, error) => {
|
|
|
258
258
|
container: textLayer,
|
|
259
259
|
viewport: viewport
|
|
260
260
|
}).render().then(() => {
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
// Directly assign the pre-calculated pt dimensions.
|
|
262
|
+
// A px→pt text replacement leaves --total-scale-factor (= zoom * PDF_TO_CSS_UNITS,
|
|
263
|
+
// correct for CSS-px font sizes) multiplying CSS pt values, making the layer
|
|
264
|
+
// ~33% too wide. Assigning styles.width/height (= raw_page_width * zoom pt)
|
|
265
|
+
// keeps font-size calculations intact while matching the page element exactly.
|
|
266
|
+
textLayer.style.width = styles.width;
|
|
267
|
+
textLayer.style.height = styles.height;
|
|
263
268
|
const rotation = textLayer.getAttribute('data-main-rotation') || '0';
|
|
264
269
|
if (transforms[rotation]) {
|
|
265
270
|
textLayer.style.transform = transforms[rotation];
|
package/dist/npm/utils.js
CHANGED
|
@@ -269,8 +269,13 @@ const renderPage = (page, emptyPage, error) => {
|
|
|
269
269
|
container: textLayer,
|
|
270
270
|
viewport: viewport
|
|
271
271
|
}).render().then(() => {
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
// Directly assign the pre-calculated pt dimensions.
|
|
273
|
+
// A px→pt text replacement leaves --total-scale-factor (= zoom * PDF_TO_CSS_UNITS,
|
|
274
|
+
// correct for CSS-px font sizes) multiplying CSS pt values, making the layer
|
|
275
|
+
// ~33% too wide. Assigning styles.width/height (= raw_page_width * zoom pt)
|
|
276
|
+
// keeps font-size calculations intact while matching the page element exactly.
|
|
277
|
+
textLayer.style.width = styles.width;
|
|
278
|
+
textLayer.style.height = styles.height;
|
|
274
279
|
const rotation = textLayer.getAttribute('data-main-rotation') || '0';
|
|
275
280
|
if (exports.transforms[rotation]) {
|
|
276
281
|
textLayer.style.transform = exports.transforms[rotation];
|
package/package.json
CHANGED