Skip to content

Commit 6bb3203

Browse files
Merge branch 'raktima-opensignlabs-patch-10' of https://github.com/OpenSignLabs/OpenSign into raktima-opensignlabs-patch-10
2 parents 0eb2c5e + 01ab19b commit 6bb3203

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

apps/OpenSign/src/components/RenderDebugPdf.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { Document, Page } from "react-pdf";
3-
import { Stage, Layer, Rect } from "react-konva";
3+
import { Stage, Layer, Rect, Text } from "react-konva";
44
const RenderDebugPdf = (props) => {
55
return (
66
<div>
@@ -47,16 +47,30 @@ const RenderDebugPdf = (props) => {
4747
{props.annotations
4848
.filter((value) => value.page === props.pageNumber)
4949
.map((value) => {
50+
const textX = value.x + value.width / 3;
51+
const textY = value.y + value.height / 2.5;
5052
return (
51-
<Rect
52-
key={value.key}
53-
x={value.x}
54-
y={value.y}
55-
width={value.width}
56-
height={value.height}
57-
fill="transparent"
58-
stroke="black"
59-
/>
53+
<React.Fragment key={value.key}>
54+
<Rect
55+
x={value.x}
56+
y={value.y}
57+
width={value.width}
58+
height={value.height}
59+
fill="#cbe9ed"
60+
stroke="black"
61+
/>
62+
<Text
63+
x={textX}
64+
y={textY}
65+
text={
66+
value?.key > 0 ? "box " + value.key.toString() : "box"
67+
}
68+
fontSize={16}
69+
fill="black"
70+
align="center"
71+
verticalAlign="middle"
72+
/>
73+
</React.Fragment>
6074
);
6175
})}
6276
</Layer>

apps/OpenSign/src/pages/DebugPdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const DebugPdf = () => {
5656
const fetchPdfMetadata = async () => {
5757
try {
5858
const pdfDataURL = URL.createObjectURL(pdf); // Convert File to data URL
59-
console.log("pdfDataURL ", pdfDataURL);
59+
// console.log("pdfDataURL ", pdfDataURL);
6060
const pdfInfo = await pdfjs.getDocument({ url: pdfDataURL }).promise;
6161
const pdfType = await inferPdfType(pdfInfo);
6262
setPdfDetails((prevDetails) => ({

0 commit comments

Comments
 (0)