C
C#16mo ago
reeeeeee

❔ Convert cshtml view to PDF file

Basically title. I had this functionality working already, but its working weirdly slow sometimes... its also probably not the best, because I am geenrating it with Puppeteer, so technically I am opening the html content in the hidden browser, and then downloading it from there. What would be the best free option to do this?
7 Replies
Pobiega
Pobiega16mo ago
Rendering it with a browser and doing "print to pdf" is probably the easiest, and thats exactly what puppeteer does.
reeeeeee
reeeeeee16mo ago
yeah i know, but for some reasong it doesnt work consistently.. sometimes it reneders it instantly, and sometimes loads for like 30sec, or doesnt even render it at all..
Pobiega
Pobiega16mo ago
Curious. I wrote something very similar using a .NET webapi that could just wrap a puppeteer script to generate PDFs, and unless the page had a lot of funky JS it worked fine
reeeeeee
reeeeeee16mo ago
Hm, i dont have any JS, so technically it should for perfect.. I will turn off the headless mode, maybe i will figure something out
Pobiega
Pobiega16mo ago
¯\_(ツ)_/¯ its hard to debug, that is one of the downsides
Angius
Angius16mo ago
*cough* QuestPDF *cough*
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts