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

parse x,y pos to numbers

parent 53290771
No related branches found
No related tags found
1 merge request!1Draft: Resolve "[Document Sealing] Implement PDF parser"
Pipeline #50136 failed
......@@ -2,8 +2,8 @@
import { IGetMetaResponse } from "./types";
declare type SealCoords = {
[key: string]: {
x: number;
y: number;
x: string;
y: string;
};
};
declare class PDFparser {
......
......@@ -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,
});
......
......@@ -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,
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment