Skip to content

Commit ae8bf18

Browse files
fix: not able draw boxes in debug ui on single page pdf
1 parent 88f2ab1 commit ae8bf18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/OpenSign/src/pages/DebugPdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const DebugPdf = () => {
7474

7575
const inferPdfType = async (pdf) => {
7676
try {
77-
const firstPage = await pdf.getPage(2);
77+
const firstPage = await pdf.getPage(pdf?.numPages > 1 ? 2 : 1);
7878
const scale = 1;
7979
const { width, height } = firstPage.getViewport({ scale });
8080
setPdfDimension({ width: width, height: height });

0 commit comments

Comments
 (0)