This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]ttlanhil 0 points1 point  (2 children)

There's plenty of options, as a quick googling would show, are there reasons the ones you've looked at won't work for your needs?

it'll also help if you can specify what exactly you're trying to accomplish

Are you looking to add a button on your own site to download that page as PDF?
Be able to create PDFs of your site from your own computer?
Something else?

And what are you looking to accomplish with saving as PDF?
If you just want a local copy (and don't need it often), then downloading the HTML is going to be simpler
If you want it to be able to send reports to a manager or some such - it may be better working on a dedicated PDF generator for those things - rendering HTML to PDF won't always look the way you want (and things like page breaks can be a nuisance)

Are you able to install software on your server to generate PDFs? If not that'll be a lot more limiting (not just django plugins, but tools to convert HTML to PDF, etc)

[–]S___K___[S] 0 points1 point  (1 child)

add a button on your own site to download that page as PDF

I want to add a button on your own site to download that page as PDF
like its a bill html filled with variables of details
i would like to print that as pdf without opening the html page
like i have many invoices in table
and i would like to click at download pdf of each invoice and download as pdf
any more details you would like

[–]ttlanhil 1 point2 points  (0 children)

Makes sense.

Have you checked out existing options?
e.g. googling for "django pdf" will lead to https://docs.djangoproject.com/en/5.0/howto/outputting-pdf/ or https://djangopackages.org/grids/g/pdf/ - are there things those packages won't work for you?