C
C#13mo ago
Gecko

✅ Anyone know the best free way for me to take a page from my site and turn it into a pdf in Blazor?

Title says it all
7 Replies
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheese13mo ago
Print to pdf
PixxelKick
PixxelKick13mo ago
Depends, does it need to be served as an already complete pdf file that one click downloads? Or is a print button -> save as pdf acceptable?
Mayor McCheese
Mayor McCheese13mo ago
ChromeHtmlToPdf 4.1.3
ChromiumHtmlToPdf is a 100% managed C# library that can be used to convert HTML to PDF or PNG format with the use of Google Chrome or Microsoft Edge
Mayor McCheese
Mayor McCheese13mo ago
A potential major consideration for programmatically printing html to pdf is that the page you're looking at may be fundamentally different at a data point level printed at a later time, even minutes later
PixxelKick
PixxelKick13mo ago
I'm a fan of using print css and a button to open up the print dialogue @media print { ... } css let's you have custom styles specifically for when your page is being printed, extremely powerful when you learn how to use it. https://developer.mozilla.org/en-US/docs/Web/Guide/Printing
MDN Web Docs
Printing - Developer guides | MDN
There may be times in which your website or application would like to improve the user's experience when printing content. There are a number of possible scenarios:
Mayor McCheese
Mayor McCheese13mo ago
There aren't great free ways tbh, you can go with an older quest pdf license. But generally in my experience free and pdf don't go together.
Want results from more Discord servers?
Add your server