From 8ba81a84986c99f2ea279d2517bca62ca17ade86 Mon Sep 17 00:00:00 2001 From: Ryan Slobojan Date: Sat, 23 Oct 2021 21:13:08 -0400 Subject: [PATCH] Fixed issue with some PDFs not detecting SHC QR codes * Doubling the pdfScale from 2 to 4 seems to make them big enough that the library can then find them --- components/Page.tsx | 3 --- src/process.ts | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/components/Page.tsx b/components/Page.tsx index 5223fd6..436cf23 100644 --- a/components/Page.tsx +++ b/components/Page.tsx @@ -36,9 +36,6 @@ function Page(props: PageProps): JSX.Element { -
-
-
) diff --git a/src/process.ts b/src/process.ts index 5eb8eff..34253c1 100644 --- a/src/process.ts +++ b/src/process.ts @@ -42,7 +42,7 @@ export async function getPayloadBodyFromFile(file: File): Promise { async function getImageDataFromPdfPage(pdfPage: PDFPageProxy): Promise { - const pdfScale = 2; + const pdfScale = 4; const canvas = document.getElementById('canvas'); const canvasContext = canvas.getContext('2d'); @@ -61,7 +61,7 @@ async function getImageDataFromPdfPage(pdfPage: PDFPageProxy): Promise