diff --git a/backend/src/controller/scans/mod.rs b/backend/src/controller/scans/mod.rs
index d32c409..c93fdfd 100644
--- a/backend/src/controller/scans/mod.rs
+++ b/backend/src/controller/scans/mod.rs
@@ -344,11 +344,12 @@ fn convert_to_pdf(image_path: &PathBuf, output_path: &PathBuf) -> Result<(), Str
};
// Rotate image 45 degrees clockwise
- let img = img.rotate270();
+ // let img = img.rotate270();
// Generate PDF
let (doc, page1, layer1) =
- PdfDocument::new("Certificado - EEGSAC", Mm(297.0), Mm(210.0), "Layer 1");
+ // PdfDocument::new("Certificado - EEGSAC", Mm(297.0), Mm(210.0), "Layer 1");
+ PdfDocument::new("Certificado - EEGSAC", Mm(210.0), Mm(297.0), "Layer 1");
let current_layer = doc.get_page(page1).get_layer(layer1);
@@ -369,6 +370,7 @@ fn convert_to_pdf(image_path: &PathBuf, output_path: &PathBuf) -> Result<(), Str
let result = doc.save(&mut BufWriter::new(File::create(output_path).unwrap()));
+ // TODO: Delete image
match result {
Ok(_) => Ok(()),
Err(reason) => {
diff --git a/frontend/src/Scans/ScansList.tsx b/frontend/src/Scans/ScansList.tsx
new file mode 100644
index 0000000..63c20ce
--- /dev/null
+++ b/frontend/src/Scans/ScansList.tsx
@@ -0,0 +1,116 @@
+import { For, createMemo } from "solid-js";
+import { ScanData, ScanResult } from ".";
+import { FilledButton } from "../components/FilledButton";
+import { FilledCard } from "../components/FilledCard";
+import { LoadingIcon } from "../icons/LoadingIcon";
+import { PDFIcon } from "../icons/PDFIcon";
+import { LoadingStatus, useLoading } from "../utils/functions";
+
+export function ScansList(props: {scanData: ScanData | null}) {
+ const {status, setStatus, error, setError} = useLoading();
+
+ const loading = createMemo(() => status() === LoadingStatus.Loading);
+
+ const convertScans = () => {
+ setStatus(LoadingStatus.Loading);
+
+ if (props.scanData === null) {
+ setError("No se detectaron escaneos");
+ setStatus(LoadingStatus.Error);
+ return;
+ }
+
+
+ fetch(
+ `${import.meta.env.VITE_BACKEND_URL}/api/scans/convert`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(props.scanData),
+ },
+ )
+ .then((res) => res.json())
+ .then((res) => {
+ setStatus(LoadingStatus.Ok);
+ console.log(res);
+ })
+ .catch((err) => {
+ setStatus(LoadingStatus.Error);
+ console.error(err);
+ });
+ };
+
+ return (
+
+
+ {path.substring(path.lastIndexOf("/") + 1)}
+
+
+ - Al convertir los escaneos a PDF se eliminan los archivos JPG.
+
+ Escaneos detectados
+
+
+
+ {dataFromScanResult(result)}
+
+ - Solo se convertiran los escaneos mostrados en esta lista.
+
+ - En la lista se muestran los nombres originales de los archivos.
+ Sin embargo, en el disco se cambiaron de nombre para asegurarse de
+ que solo 1 persona pueda transformarlos a la vez.
+
ESCANEOS
, y los mostrará en una lista.
- - La detección demora aprox. 1 segundo por cada archivo que - cumple con los parámetros. -
-- Si la detección demora más de 90 segundos, se cancelará. -
-
- {path.substring(path.lastIndexOf("/") + 1)}
-
-
- {dataFromScanResult(result)}
-
- - Al convertir los escaneos a PDF se eliminan los archivos JPG.
-
- - Solo se convertiran los escaneos mostrados en esta lista.
-
- - Si ejecutas la detección de escaneos nuevamente los nombres de
- los archivos cambiarán. Esto es normal. El contenido de los JPG
- es el mismo.
-