Skip to content

Commit 36377ee

Browse files
committed
update add image output
1 parent 1743571 commit 36377ee

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

samples/louie-drivers-license/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ <h1 class="home-page-title">Read a Driver's License</h1>
8989

9090
const result = await scanner.launch();
9191
console.log(result);
92-
result.originalImageResult.toCanvas().then(canvas => {
93-
// Optional: style or size the canvas
94-
canvas.style.maxWidth = "100%";
95-
canvas.style.display = "block";
96-
canvas.style.margin = "16px auto";
97-
98-
// Decide *where* it should live
99-
const container = document.querySelector(".parsed-result-view");
100-
container.prepend(canvas); // or appendChild
101-
});
92+
const canvas = result.originalImageResult.toCanvas();
93+
94+
// Optional styling
95+
canvas.style.maxWidth = "100%";
96+
canvas.style.display = "block";
97+
canvas.style.margin = "16px auto";
98+
99+
// Put it somewhere sensible
100+
const container = document.querySelector(".parsed-result-view");
101+
container.prepend(canvas);
102102

103103
if (result.barcodeResults.length > 0) {
104104
let processedResult;

0 commit comments

Comments
 (0)