Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,6 +33,7 @@ custom_css = """
|
|
33 |
margin: 0 auto; /* Center the block */
|
34 |
overflow: auto; /* Ensure content is scrollable if it exceeds the block size */
|
35 |
gap: 10px; /* Add gap between elements */
|
|
|
36 |
}
|
37 |
.gradio-container{
|
38 |
background-color: white;
|
@@ -76,6 +77,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
76 |
|
77 |
gr.Markdown("# Plataforma de Generación de Informes de ViLAB", elem_id="title")
|
78 |
|
|
|
|
|
79 |
gr.Markdown("### Ingrese el nombre de su empresa y su logo [opcional].", elem_id="subtitle")
|
80 |
|
81 |
header_items = []
|
@@ -183,6 +186,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
183 |
with gr.Row():
|
184 |
submit_button = gr.DownloadButton (label="Generar Reporte")
|
185 |
|
|
|
|
|
186 |
# Función para mantener la relación de aspecto de la imagen
|
187 |
def get_aspect_ratio_image_size(img, max_width, max_height):
|
188 |
width, height = img.size
|
@@ -314,9 +319,9 @@ Resumen:"""
|
|
314 |
pdf_path = "./documento_generado.pdf"
|
315 |
pdf.output(pdf_path)
|
316 |
|
317 |
-
return pdf_path
|
318 |
|
319 |
-
submit_button.click(get_values, header_items + textboxes + img_desc_boxes,
|
320 |
|
321 |
if __name__ == "__main__":
|
322 |
|
|
|
33 |
margin: 0 auto; /* Center the block */
|
34 |
overflow: auto; /* Ensure content is scrollable if it exceeds the block size */
|
35 |
gap: 10px; /* Add gap between elements */
|
36 |
+
border: 1px solid #000;
|
37 |
}
|
38 |
.gradio-container{
|
39 |
background-color: white;
|
|
|
77 |
|
78 |
gr.Markdown("# Plataforma de Generación de Informes de ViLAB", elem_id="title")
|
79 |
|
80 |
+
gr.Markdown("Importante: Plataforma de prueba experimental, se limita solo al uso didáctico.")
|
81 |
+
|
82 |
gr.Markdown("### Ingrese el nombre de su empresa y su logo [opcional].", elem_id="subtitle")
|
83 |
|
84 |
header_items = []
|
|
|
186 |
with gr.Row():
|
187 |
submit_button = gr.DownloadButton (label="Generar Reporte")
|
188 |
|
189 |
+
file_output = gr.File(interactive=False, visible=False)
|
190 |
+
|
191 |
# Función para mantener la relación de aspecto de la imagen
|
192 |
def get_aspect_ratio_image_size(img, max_width, max_height):
|
193 |
width, height = img.size
|
|
|
319 |
pdf_path = "./documento_generado.pdf"
|
320 |
pdf.output(pdf_path)
|
321 |
|
322 |
+
return gr.File(pdf_path, interactive=False, visible=True)
|
323 |
|
324 |
+
submit_button.click(get_values, header_items + textboxes + img_desc_boxes, file_output)
|
325 |
|
326 |
if __name__ == "__main__":
|
327 |
|