@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 CHANGED
@@ -258,8 +258,13 @@ export const renderPage = (page, emptyPage, error) => {
258
258
  container: textLayer,
259
259
  viewport: viewport
260
260
  }).render().then(() => {
261
- textLayer.style.width = textLayer.style.width.replace(/px/g, 'pt');
262
- textLayer.style.height = textLayer.style.height.replace(/px/g, 'pt');
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];
@@ -258,8 +258,13 @@ export const renderPage = (page, emptyPage, error) => {
258
258
  container: textLayer,
259
259
  viewport: viewport
260
260
  }).render().then(() => {
261
- textLayer.style.width = textLayer.style.width.replace(/px/g, 'pt');
262
- textLayer.style.height = textLayer.style.height.replace(/px/g, 'pt');
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
- textLayer.style.width = textLayer.style.width.replace(/px/g, 'pt');
273
- textLayer.style.height = textLayer.style.height.replace(/px/g, 'pt');
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-pdfviewer-common",
3
3
  "description": "Kendo UI TypeScript package exporting functions for PDFViewer component",
4
- "version": "1.0.0-develop.3",
4
+ "version": "1.0.0-develop.4",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],