Skip to content
Snippets Groups Projects
Commit e8de4180 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

debug

parent e266467d
No related branches found
No related tags found
1 merge request!1Draft: Resolve "[Document Sealing] Implement PDF parser"
Pipeline #50151 failed with stages
in 20 seconds
...@@ -54,12 +54,14 @@ class PDFparser { ...@@ -54,12 +54,14 @@ class PDFparser {
for (let index = 0; index < pages.length; index++) { for (let index = 0; index < pages.length; index++) {
const page = pages[index]; const page = pages[index];
console.log(coords[index + 1]); console.log(coords[index + 1]);
console.log(typeof coords[index + 1] !== "undefined");
const x = typeof coords[index + 1] !== "undefined" const x = typeof coords[index + 1] !== "undefined"
? parseFloat(coords[index + 1]["x"]) ? parseFloat(coords[index + 1].x)
: null; : null;
const y = typeof typeof coords[index + 1] !== "undefined" const y = typeof typeof coords[index + 1] !== "undefined"
? parseFloat(coords[index + 1]["y"]) ? parseFloat(coords[index + 1].y)
: null; : null;
console.log(x, y);
if (x && y) { if (x && y) {
page.drawImage(img, { page.drawImage(img, {
x, x,
......
...@@ -71,17 +71,19 @@ class PDFparser { ...@@ -71,17 +71,19 @@ class PDFparser {
const page = pages[index]; const page = pages[index];
console.log(coords[index + 1]); console.log(coords[index + 1]);
console.log(typeof coords[index + 1] !== "undefined");
const x = const x =
typeof coords[index + 1] !== "undefined" typeof coords[index + 1] !== "undefined"
? parseFloat(coords[index + 1]["x"]) ? parseFloat(coords[index + 1].x)
: null; : null;
const y = const y =
typeof typeof coords[index + 1] !== "undefined" typeof typeof coords[index + 1] !== "undefined"
? parseFloat(coords[index + 1]["y"]) ? parseFloat(coords[index + 1].y)
: null; : null;
console.log(x, y);
if (x && y) { if (x && y) {
page.drawImage(img, { page.drawImage(img, {
x, x,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment