implemented barcode decoder

This commit is contained in:
2024-02-12 14:58:31 +01:00
parent 89c1ec57a4
commit c833a4afe6
4 changed files with 273 additions and 80 deletions

View File

@@ -7,7 +7,7 @@ import { useFormState } from "react-dom";
import { updateOrAddBill } from "../lib/actions/billActions";
import Link from "next/link";
import { formatYearMonth } from "../lib/format";
import { pdf2canvas } from "../lib/pdf/pdf2png";
import { findDecodePdf417 } from "../lib/pdf/barcodeDecoder";
// Next.js does not encode an utf-8 file name correctly when sending a form with a file attachment
// This is a workaround for that
@@ -40,7 +40,7 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
}
const billAttachment_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
pdf2canvas(event);
findDecodePdf417(event).then(result => console.log(result));
}
return(