from fpdf import FPDF
import os
from PIL import Image
class PDF(FPDF):
def header(self):
self.set_font("Arial", 'B', 16)
# Aquí podrías agregar un logo o algo más si deseas
def chapter_title(self, title):
self.set_font("Arial", 'B', 16)
self.cell(0, 10, title, ln=True, align='C')
self.ln(5)
def chapter_body(self, body):
self.set_font("Arial", '', 12)
self.multi_cell(0, 10, body)
self.ln()
pdf = PDF(format='A4')
pdf.set_auto_page_break(auto=True, margin=15)
# Ejemplo: agregar portada
pdf.add_page()
pdf.chapter_title("Coloreando mis emociones")
# Suponiendo que tengas una imagen de portada en color en la ruta especificada
portada = "/mnt/data/tu_portada_color.png" # Asegúrate de cambiar la ruta
if os.path.exists(portada):
pdf.image(portada, x=10, y=30, w=pdf.w - 20)
pdf.ln(20)
# Agrega la dedicatoria
pdf.add_page()
pdf.chapter_title("Dedicatoria")
dedicatoria_text = (
"Para mis hijos,\n\n"
"Ustedes me enseñan cada día, me muestran un mar de emociones. "
"Un día lloramos de risa y al rato lloramos porque estamos tristes. "
"Cada momento es algo nuevo, una aventura. Nos peleamos, nos enojamos, nos abrazamos, "
"nos reconciliamos y nos amamos… Siempre, en todo momento, nos acompañamos. "
"Somos unidos, y cada uno tiene su propia personalidad y complementa al otro. "
"No somos perfectos, somos humanos y tratamos de encajar en la vida del otro."
)
pdf.chapter_body(dedicatoria_text)
# Agrega la introducción para adultos
pdf.add_page()
pdf.chapter_title("Introducción para adultos")
intro_text = (
"Este libro fue pensado con mucho cariño para acompañar a los peques en el descubrimiento de sus emociones. "
"Colorear, identificar lo que sienten, y ponerle nombre a esas sensaciones ayuda a crecer y construir vínculos más sanos. "
"Acompañar este proceso con amor y atención es fundamental. ¡Disfruten del viaje!"
)
pdf.chapter_body(intro_text)
# Continúa agregando cada sección (Guía, Presentación, cada emoción, versión abreviada, reflexión final, diploma...)
# Aquí va como ejemplo la Guía y la Presentación
pdf.add_page()
pdf.chapter_title("¿Cómo usar este libro?")
guia_text = (
"1. Observen la ilustración y conversen sobre lo que ven.\n"
"2. Coloreen libremente, sin importar si usan los colores “reales” o de su elección.\n"
"3. Lean la frase que acompaña cada emoción y compartan lo que les inspira.\n"
"4. Resuelvan la actividad breve: e.g., “¿Qué me da miedo?”.\n"
"5. Conversen y validen lo que sienten. No existen respuestas correctas."
)
pdf.chapter_body(guia_text)
pdf.add_page()
pdf.chapter_title("¡Hola, peques!")
presentacion_text = (
"¡Hola, peques!\n\n"
"Este libro es para vos. Aquí vas a descubrir, dibujar y conocer tus emociones. "
"Cada página es tuya para colorear, imaginar y sentir. ¡Vamos a comenzar este viaje juntos!"
)
pdf.chapter_body(presentacion_text)
# Agrega más páginas según cada emoción y actividad...
# Por ejemplo:
pdf.add_page()
pdf.chapter_title("¿Qué me da miedo?")
# Agrega la imagen de la emoción
emocion_img = "/mnt/data/A_black_and_white_line_drawing_coloring_page_for_c.png" # Actualiza la ruta
if os.path.exists(emocion_img):
pdf.image(emocion_img, x=15, w=pdf.w - 30)
# Puedes agregar un texto de actividad si lo deseas
pdf.chapter_body("Colorea la imagen y después escribe o cuenta: ¿Qué te da miedo?")
# Al final, agrega la reflexión final y el diploma...
pdf.add_page()
pdf.chapter_title("Reflexión final")
reflexion_text = (
"Reconocer nuestras emociones y aprender a expresarlas no solo nos ayuda a conocernos mejor, "
"sino que también nos permite convivir en armonía con los demás. La educación emocional es una herramienta "
"valiosa en los tiempos que vivimos, una base fundamental para crecer, aprender y construir vínculos más sanos. "
"Que este libro sea una puerta abierta para descubrir ese mundo interior que habita en cada niño, en cada familia, "
"y en cada corazón."
)
pdf.chapter_body(reflexion_text)
pdf.add_page()
pdf.chapter_title("Diploma de Explorador de Emociones")
diploma_text = (
"Este diploma se otorga a: _________________________\n\n"
"Por haber recorrido este camino de emociones, reconociendo y aprendiendo a expresarlas. "
"¡Felicitaciones por dar el primer paso hacia el crecimiento personal!"
)
pdf.chapter_body(diploma_text)
# Guarda el PDF final
pdf_output_path = "/mnt/data/Explorador_de_Emociones_Maruk.pdf"
pdf.output(pdf_output_path)
print("PDF generado en:", pdf_output_path)
I got same the issue, I can launch the app by App Actions Test tool but when I publish on internal test and download by the link. I can't launch the app and catch the feature by Google Assistance voice or text. The Google Assistance always open the browser. Did you find the reason?
are there any updates on this? I found this thread because I had the same question. I want to compress a video stream in YUY2 or UYVY format to, say H265. If I understand the answers given here correctly, I should be able use the function av_image_fill_arrays() to fill the data and linesize arrays of an AVFrame object, like this:
and call avcodec_send_frame(), followed by calling avcodec_receive_packet() to get encoded data.
I must have done something wrong. The result is not correct. For example, rather than a video with a person's face showing in the middle of the screen, I get a mostly green screen with parts of the face showing up at the lower left and lower right corners.
I tried it but it didn't really work. I am still facing this issue any run time validations in dto file after being build they are being removed. Is there any solution foo it ?
Reasons:
Blacklisted phrase (1.5): any solution
Blacklisted phrase (1): Is there any
RegEx Blacklisted phrase (2): any solution foo it ?
Having the same issue. Did you find a solution? Was able to clear the error by deleting the DNS IP address in Tailscale and re-entering. Will see if the error returns.
Reasons:
RegEx Blacklisted phrase (3): Did you find a solution
Of course, I can get the second link by right-clicking on the open image in full size that is embedded in my MessageEmbed().setImage() and click copy the link given, but I want this link to also be inserted into MessageEmbed().setDescription() so that clicking on the link immediately opens the link of user
Look at Minecraft, developed in Java and good performance for kinda big game, so it's more about what is your quality of code and how you optimize it, then about GC imo.
I've run into a strange PWA layout issue too and tried just about everything! In a browser, my app runs fine (Safari, Chrome, Edge, Firefox). Soon as I install it as a PWA, in iOS I have a half inch empty gap at the top and in Android, the header goes up by half inch can't be accessed.
I had a similar problem, and while trying out the many and diverse possible solutions offered here, I ended up with a much bigger problem: My screen resolution is suddenly stuck at 800 x 600. So I started searching for solutions to this new problem, and they are similarly many and diverse, and none of them are working. Has anyone else had this happen while doing anything described in this thread?
HI can u give me the sample code I am getting error while performing it
Validation error. error 80080204: App manifest validation error: Line 40, Column 12, Reason: If it is not an audio background task, it is not allowed to have EntryPoint="BGTask.ToastBGTask" without ActivatableClassId in windows.activatableClass.inProcessServer.
When i uninstall tensorflow 2.15.0 and keras 2.15.0 and then first install tensorflow and then install keras the problem resolved. Maybe first install keras will cause tensorflow.keras not install properly?
I am facing same issue. I have a script placed on a server. Server already has kubectl and aws cli installed.
WHEN SCRIPT IS EXECUTED WITH AWS SSM
script runs eks update kubeconfig and then kubectl command, which fails with below error:
ERROR-------
E0417 15:54:14.627818 31772 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"http://localhost:8080/api?timeout=32s\": dial tcp 127.0.0.1:8080: connect: connection refused"
The connection to the server localhost:8080 was refused - did you specify the right host or port?
WHEN SCRIPT IS EXECUTED DIRECTLY FROM SERVER, IT PASSES THROUGH.
Note: the user in both case is root that is checked with whom.
Please help me if you found a solution.
como hago dos histogramas cuando tengo una variable con dos niveles que son lugar 1 y lugar 2, pero estos estan en una sola columna . cuando realizo el histograma me toma todos los datos , no los discrimina por lugar. mi variabla respuesta es contenido de vit C
nota:los niveles de lugar estan uno a continuacion de otro ,
mi pregunta es como le digo a R que tome los datos del lugar 1 para el histogrma
y tome los datos del lugar 2 para el otro histograma
I have the same issue, the app remains unaware whether the code is entered and subscription is redeemed from App Store or not. The user has to close the app and restart it and again enter the iCloud password which then detects that a subscription is active, then it lets the user use the app.
Is it the same case for you?
I am developing in Flutter by the way.
If yes and you've found a solution, please help me also.
doc.add_paragraph("[Nombre del comercio o responsable]")
doc.add_paragraph("[Nombre del establecimiento]")
doc.add_paragraph("Presente.\n")
# Cuerpo de la carta
body = (
"Estimados señores:\\n\\n"
"¡Un cordial saludo de parte del grupo juvenil \*Pela’os Activos\*! En alianza con la fundación española "
"\*\*Donesacull\*\*, nos encontramos organizando una actividad muy especial que busca dejar huellas positivas "
"en nuestra comunidad.\\n\\n"
"El próximo 19 de octubre de 2025, estaremos llevando a cabo una jornada solidaria en la comunidad de "
"La Coloradita, en La Peña, Santiago de Veraguas, donde haremos entrega de regalos, útiles escolares, ropa y más "
"a niños, niñas y familias en situación vulnerable.\\n\\n"
"Para hacer esto posible, estamos buscando aliados estratégicos como ustedes. Queremos invitarlos a ser parte de este "
"proyecto a través de patrocinio o descuentos especiales en sus productos o servicios. Su aporte no solo nos ayudará a lograr "
"un mayor alcance, sino que también posicionará su marca como un comercio con conciencia social.\\n\\n"
"A cambio, ofrecemos publicidad directa en nuestras redes sociales, donde destacaremos su negocio como uno de nuestros "
"patrocinadores oficiales. Haremos publicaciones agradeciendo su apoyo, mencionando su marca y mostrando cómo su contribución "
"hace la diferencia.\\n\\n"
"No es solo una donación. Es una oportunidad de conectar con la comunidad, ganar visibilidad y ser parte de una causa que transforma vidas.\\n\\n"
"Nos encantaría reunirnos o conversar con ustedes para compartir más detalles y escuchar sus ideas de colaboración.\\n\\n"
"Gracias por considerar ser parte de este sueño con impacto real. ¡Contamos con ustedes!\\n\\n"
"Con aprecio,\\n\\n"
"\[Tu nombre y apellido\]\\n"
"Representante – Pela’os Activos\\n"
"Tel.: \[tu número\]\\n"
"Correo: \[tu correo electrónico\]\\n"
"Instagram/Facebook: @PelaosActivos"
Unfortunately I can't comment, but if it's failing it could be that the file formatting is affecting the read, specifically for java? Is it windows, linux, mac? That may affect file encoding. Ensure the file has a newline at the end, and maybe even ensure there aren't any hidden characters that may be throwing off the read of the properties. Last it may be that java isn't executing with the same user so maybe it's searching in a different directory?
this version does work as mentioned above devtools::install_github("dmurdoch/leaflet@crosstalk4")
BUT it is not compatible with recent versions of r leaflet. any suggestions?
Turns out the issue was that, I was using only one subtable. Each subtable get computed once so if multiple pairings are in there it doesnt work. The solution was to create more GPOS subtables and split the pairings accordingly.
Sorry, not an answer, but I don't have enough creds to comment...
Thanks for posting. I'm having the same issue with one of my workspaces that contains both git source-controlled directories and non-git directories, yet I can open other workspaces that also contain both git source-controlled directories and non-git directories and NOT see the same issue.
The only difference I see in the structure of the workspace files is that the one with the problem has entries like
I was able to make it work by activating the region in both the account that makes the STS request and the account where the credentials are generated -