From e8de41808e7cc80ca7df0615d17af4f0ed520813 Mon Sep 17 00:00:00 2001
From: Zdravko Iliev <zdravko.iliev@vereign.com>
Date: Fri, 15 Apr 2022 14:23:38 +0300
Subject: [PATCH] debug

---
 dist/pdfParser.js | 6 ++++--
 src/pdfParser.ts  | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dist/pdfParser.js b/dist/pdfParser.js
index 96afafb..029187e 100644
--- a/dist/pdfParser.js
+++ b/dist/pdfParser.js
@@ -54,12 +54,14 @@ class PDFparser {
             for (let index = 0; index < pages.length; index++) {
                 const page = pages[index];
                 console.log(coords[index + 1]);
+                console.log(typeof coords[index + 1] !== "undefined");
                 const x = typeof coords[index + 1] !== "undefined"
-                    ? parseFloat(coords[index + 1]["x"])
+                    ? parseFloat(coords[index + 1].x)
                     : null;
                 const y = typeof typeof coords[index + 1] !== "undefined"
-                    ? parseFloat(coords[index + 1]["y"])
+                    ? parseFloat(coords[index + 1].y)
                     : null;
+                console.log(x, y);
                 if (x && y) {
                     page.drawImage(img, {
                         x,
diff --git a/src/pdfParser.ts b/src/pdfParser.ts
index 4231539..c296df7 100644
--- a/src/pdfParser.ts
+++ b/src/pdfParser.ts
@@ -71,17 +71,19 @@ class PDFparser {
       const page = pages[index];
 
       console.log(coords[index + 1]);
+      console.log(typeof coords[index + 1] !== "undefined");
 
       const x =
         typeof coords[index + 1] !== "undefined"
-          ? parseFloat(coords[index + 1]["x"])
+          ? parseFloat(coords[index + 1].x)
           : null;
 
       const y =
         typeof typeof coords[index + 1] !== "undefined"
-          ? parseFloat(coords[index + 1]["y"])
+          ? parseFloat(coords[index + 1].y)
           : null;
 
+      console.log(x, y);
       if (x && y) {
         page.drawImage(img, {
           x,
-- 
GitLab