[Flask] Printing on formatted paper?

hi at jnnkb.eu hi at jnnkb.eu
Mon Jul 4 05:15:58 EDT 2022


Hey, I think the easiest way is probably to create a route that contains the information you want in a nicely formated HTML and then let the browser convert that to a PDF. You could also use your normal route (e.g. your standart invoices route) and provide some additional CSS to format it nicely for printing. Maybe this rather old blog post helps you getting started: https://drublic.de/blog/printing-the-web

Greetings

On July 4, 2022 4:39:00 AM GMT+03:00, CCP Dragonedge <ccp at drsb.com.my> wrote:
>Hi,
>
>I created a very simple inventory system for my company using Flask.
>
>One of the functions in my system allows users to print out a list of
>inventory. Kind of cheating - I just create a CSV file, and tell the user
>to download it and use Excel to print.
>
>I wonder, however, if there is a way to do "nice" printing. For example,
>like on a formatted sheet of paper (e.g. invoices). Can you actually
>manipulate printing at the Python / Flask level?
>
>Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/flask/attachments/20220704/ff51738e/attachment.html>


More information about the Flask mailing list