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
This commit is contained in:
parent
67a4a15007
commit
8ba81a8498
|
@ -36,9 +36,6 @@ function Page(props: PageProps): JSX.Element {
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<canvas id="canvas" style={{display: 'none'}}/>
|
<canvas id="canvas" style={{display: 'none'}}/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -42,7 +42,7 @@ export async function getPayloadBodyFromFile(file: File): Promise<PayloadBody> {
|
||||||
|
|
||||||
async function getImageDataFromPdfPage(pdfPage: PDFPageProxy): Promise<ImageData> {
|
async function getImageDataFromPdfPage(pdfPage: PDFPageProxy): Promise<ImageData> {
|
||||||
|
|
||||||
const pdfScale = 2;
|
const pdfScale = 4;
|
||||||
|
|
||||||
const canvas = <HTMLCanvasElement>document.getElementById('canvas');
|
const canvas = <HTMLCanvasElement>document.getElementById('canvas');
|
||||||
const canvasContext = canvas.getContext('2d');
|
const canvasContext = canvas.getContext('2d');
|
||||||
|
@ -61,7 +61,7 @@ async function getImageDataFromPdfPage(pdfPage: PDFPageProxy): Promise<ImageData
|
||||||
await renderTask.promise;
|
await renderTask.promise;
|
||||||
|
|
||||||
// Return PDF Image Data
|
// Return PDF Image Data
|
||||||
return canvasContext.getImageData(0, 0, canvas.width, canvas.height);
|
return Promise.resolve(canvasContext.getImageData(0, 0, canvas.width, canvas.height));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue