diff --git a/dist/pdfParser.d.ts b/dist/pdfParser.d.ts index 6c2649943e18644c21dc34efe0df46ebd35bf896..d278d188080d4bc5cd00f2dd47386dcda0eea723 100644 --- a/dist/pdfParser.d.ts +++ b/dist/pdfParser.d.ts @@ -2,8 +2,8 @@ import { IGetMetaResponse } from "./types"; declare type SealCoords = { [key: string]: { - x: number; - y: number; + x: string; + y: string; }; }; declare class PDFparser { diff --git a/dist/pdfParser.js b/dist/pdfParser.js index 4fa7086ac692e2076603e111af0646973dcd4452..c7003236239b98724e9bfa55e665409796297d98 100644 --- a/dist/pdfParser.js +++ b/dist/pdfParser.js @@ -53,14 +53,14 @@ class PDFparser { for (let index = 0; index < pages.length; index++) { const page = pages[index]; page.drawImage(img, { - x: coords[index + 1].x, - y: coords[index + 1].y, + x: parseFloat(coords[index + 1].x), + y: parseFloat(coords[index + 1].y), width: scaled.width, height: scaled.height, }); const link = this.createPageLinkAnnotation(page, url, { - imgXPos: coords[index + 1].x, - imgYPos: coords[index + 1].y, + imgXPos: parseFloat(coords[index + 1].x), + imgYPos: parseFloat(coords[index + 1].y), imgWidth: scaled.width, imagHeight: scaled.height, }); diff --git a/src/pdfParser.ts b/src/pdfParser.ts index fe1fa8fc9e71501d2b36134d004239b50ecfb61c..1f6105869318768331b8164411dfe3a3af5a3472 100644 --- a/src/pdfParser.ts +++ b/src/pdfParser.ts @@ -8,7 +8,7 @@ import { AppError, GeneralError } from "./lib/errors"; import { isPDF } from "./lib/generalUtils"; type SealCoords = { - [key: string]: { x: number; y: number }; + [key: string]: { x: string; y: string }; }; class PDFparser { @@ -69,15 +69,15 @@ class PDFparser { const page = pages[index]; page.drawImage(img, { - x: coords[index + 1].x, - y: coords[index + 1].y, + x: parseFloat(coords[index + 1].x), + y: parseFloat(coords[index + 1].y), width: scaled.width, height: scaled.height, }); const link = this.createPageLinkAnnotation(page, url, { - imgXPos: coords[index + 1].x, - imgYPos: coords[index + 1].y, + imgXPos: parseFloat(coords[index + 1].x), + imgYPos: parseFloat(coords[index + 1].y), imgWidth: scaled.width, imagHeight: scaled.height, });