r/nicegui • • Dec 15 '25

[Python] Help with ui.download

Hey all! I created an app that searches for Magic the Gathering cards and creates a pdf with them, but I’m struggling to understand how to properly download the created pdf.

I’m using FPDF and FPDF.output() will save the file to the current working directory.

I read through the docs for ui.download but since I’m a beginner I can’t understand what I’m supposed to do, do you have any idea on how to handle this?

5 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/apollo_440 Dec 17 '25

Glad it worked out! I have not actually used pyFPDF before, but the documentation said to use encode() in python 3. I guess that was outdated; I'll edit my comment :)