Get the source code for this video for FREE → the-dotnet-weekly.ck.page/html-to-pdf Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@@MilanJovanovicTech Honestly not at all, the one issue at first was file size but they have since fixed that issue. It's incredibly fast to create new reports/layouts, is pretty intuitive once you learn about the flow, and the hot-reload previewer is amazing
IronPDF uses Chromium under the hood. You can achieve the same result without paying 1 cent for the tool. A more lightweight option would be wkhtml2pdf (little bit outdated though, in terms of CSS features), which could cover simple cases, like shown in the video.
Still a good Option for simple stuff i mean 2020 is still pretty new and mostly nobody needs the new features and this way you can create a fully free pdf creation service for many things. My team and i through of using something like this
@@flobuilds Yes it is. I used it a lot in my previous job. We could handle any case, like invoices, tickets with QR codes and customized badges in formats like A6. In my new job we decided to use Puppeteer with Chromium, where the browser runs in a docker container in headless mode, listening on a websocket for print jobs. This approach also allows you to scale PDF generation seperately and removes some load from your main application.
Yes, IronPdf supports rendering headers and footers in PDF documents. You can easily add text or HTML headers and footers to your PDFs, allowing for customization such as including page numbers, logos, or other relevant information.
Some days ago I came across a video (I guess that was your or maybe Nick Chapsa video) that was using blazor to create html template and then send on email or print as pdf. If was your video then kindly put it's link to me cause I was not able to find. And I have a question regarding that. I have a microservices architecture web apis, is that a good practice to create a separate project of blazor and create dynamic html template and send in email, or print as pdf? I want to avoid using libraries?
@ Razor Pages + HTML+ HTMX + AlpineJS . It’s works pretty well for partial rendering. Have you ever tried? Is it good to use these stack for large application ?
I have a license that is about a year or two years old of IronPdf library, but when you deploy your applications it is a hassle because some libraries have to be installed in the server. So if you are deploying to Linux, you may run into an issue where these libraries don’t get installed and you need up creating symbols to match the version it needs, very painful.
I don’t know if they have fixed this issue yet, but it also deploys all the languages. In the version I have there was no way to select what languages to deploy. It would just deploy everything. By the way I really like you share a lot of your experience. Thank you!
I can't decide, generate pdf in blazor wasm with the JsPdf library or generate in my webapi and view in blazor, the AI doesn't recommend me in the webapi due to traffic, friend, what do you recommend me to generate in the frontend or in the backend?. Greetings from Paraguay.
On a real project, which endpoint resource group (controller) would you put this route to generate those invoices? /invoices /invoices-report (As you've shown us) /reports Which routes / resources would you usually put those reports generations? I have some "patterns" and thoughts around that, but I'd like to see your POV
I have looked into IronPdf a lot, and even though they are fairly good, their Chrome identical renderer is not completely Chrome identical, and it is super expensive.
@@MilanJovanovicTech I ended up with a solution where I use RazorLight for templating, and then I use Browserless which exposes Puppeteer as an API to turn HTML into a PDF file. It works great, but it is a bit slow to render the HTML before it saves it to a PDF.
Where I work we needed the presision which HTML just can't provide, therefore we went with QuestPDF, and it have been great. Sometimes you can feel from the lack of options that it is a 1 man project, but the options you don't have available isn't something you can't make yourself. We also had some issues with an update, which broke support for linux for a few days. But after reporting the problem to the dev, it got solved rather quickly, and he also seem to be pretty responsive to questions and problems that come in, can only recommend. We also tried IronPDF to see if it was good enough, due to its simplicity, but it wasn't due to the nature of html to pdf conversion. But if all you need to do is print out invoices and money isn't an issue, it is very simple to setup.
Interesting. What was your use case that HTML couldn't solve from a precision standpoint? There's always the risk of betting on a one-man project, though.
Nice Video and approach but sadly IronPDF is very expensive. A good alternative is QuestPDF but that's C# code to PDF. What is also working is using Razor Components (not views)
As everything it depends. If you know you would have constant structure of pdf file, you can use quest pdf and try to format file with quest pdf c# code. But there are some business cases when you need flexibility in customizing file template without deploying new version of the application (multitenancy for example)
@@mateuszadamowicz770 yea i totally agree, that's why I mentioned that questpdf is c# code to pdf. It is more difficult to make flexible but has the same functionalities in generating the output pdf.
Well. such a interesting topic to cover and this time you video is just an ad :( 1. There are better 'paid' option: Syncfusion html to pdf with community license if you work for company with revenue under $1 million. 2. Quest PDF is such a great library to that a bit differentely. Lastly, you did not produced proper invoice document. No header, no page number, no nothing starting from page 2. Sorry ! I know you can do better, but you haven't in this video!
Sorry for not implementing a production ready solution in 15 min, I guess. 🤷♂️ But this is more of a proof of concept, that can be extended further. As for the invoice structure, we can be nitpicky. It will depend on what you need to do. My invoices are way simpler than this, and I'm doing just fine. It doesn't have to be shiny. I didn't know about Syncfusion, will check it out. QuestPDF would have taken much more code to pull something like this off, p)us there's a learning curve to the library. Most teams will have someone good with HTML that could extend the implementation I showed.
@@MilanJovanovicTech That's why I've mentioned syncfusion as it offers the same functionality. Using HTML table with / would not take longer than using divs but would've resolved a lot of issues. As a matter of fact, html table is the way to implement any kind of printed document ( official company's document ) and that should've been said as most important thing in the video no matter what tool it's being used to convert HTML to PDF. I agree that Quest PDF requires some practivce / kwnoledge.
Developers are typically much more expensive 😅 That being said, what if it's the only solution to your problem? I bet you'd happily pay. Of course, it's an open market, and there are many other alternatives.
Is there anything come with no cost? We should support a good software that does the job well and help the business save the cost instead of writing some low quality and maintainable code to proof the existence of development.
@@MilanJovanovicTechwhile its an interesting tool, but you could have let people know about the licensing, first before continuing showing it off. For smaller projects not interesting, for hobby projects also not interesting; for bigger companies sure.
This and most solutions using (Razor) Views and models work best with fixed data structures. We have a solution that generates documents on structures where we don't know the fields, and don't know the content. The customer does know content and structure so we made our own field merging engine that can still be used with any type of template and is rendersed to pdf ultimately with EssentialObjects pdf (and just recently I added support for IronPdf as well). Our content could also generate export files with very variable length, and could even use several file based templates to generated compound documents. Because of the nature of our "models" we cannot use the very nice Model support that Razor has. If anyone has any ideas on how to use Models with unknown datastructures, perhaps even anonymous types I would love some direction because we could remove a lot of complex custom code :-) and rely more on standard libraries
D/M/Y is the only way! lol, you might have just started an issue, but I agree there🤜🏼
10 місяців тому+3
only accepted date format should be the ISO :D anyways, no matter how you separate them, but we should keep going from larger units to smaller units as with every other thing in life. hours:minutes:seconds, millions,thousands,dollars.
I like yyyy/MM/dd way more. It can be sorted in a more meaningful way I think. On the topic. Can be done using OSS, but the implementation is mostly forced upon the programmer. It's not as simple as just calling one static method. Especially page brakes are a pain in the butt. I would guess that IronPDF is using the Chromium engine under the hood. So you could basically create IronPDF yourself, but the amount of work you have to put into it... brotha
Get the source code for this video for FREE → the-dotnet-weekly.ck.page/html-to-pdf
Want to master Clean Architecture? Go here: bit.ly/3PupkOJ
Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
QuestPDF has been one of the best tools I’ve ever worked with. Saved us sooo much money for reports and invoice layouts
That's awesome. Did you run into any roadblocks with QuestPDF given that it's C# -> PDF?
@@MilanJovanovicTech Honestly not at all, the one issue at first was file size but they have since fixed that issue. It's incredibly fast to create new reports/layouts, is pretty intuitive once you learn about the flow, and the hot-reload previewer is amazing
but isn't quest pdf a paid library ?
@@okharev8114 it’s free for companies with under $1mm revenue
It's amazing. Personally i never used IronPDF neither another PDF library. After view this video I'll test IronPDF. Thanks Milan.
You're welcome :)
Be sure to use the free trail key
IronPDF uses Chromium under the hood. You can achieve the same result without paying 1 cent for the tool. A more lightweight option would be wkhtml2pdf (little bit outdated though, in terms of CSS features), which could cover simple cases, like shown in the video.
Little bit outdated? 😅
@@MilanJovanovicTech Yes, the last update was in 2020 😬
Still a good Option for simple stuff i mean 2020 is still pretty new and mostly nobody needs the new features and this way you can create a fully free pdf creation service for many things. My team and i through of using something like this
@@flobuilds Yes it is. I used it a lot in my previous job. We could handle any case, like invoices, tickets with QR codes and customized badges in formats like A6.
In my new job we decided to use Puppeteer with Chromium, where the browser runs in a docker container in headless mode, listening on a websocket for print jobs. This approach also allows you to scale PDF generation seperately and removes some load from your main application.
It would be cool to be able to have a footer per page with the html renderer.
I'll cover that in an article next few weeks
Yes, IronPdf supports rendering headers and footers in PDF documents. You can easily add text or HTML headers and footers to your PDFs, allowing for customization such as including page numbers, logos, or other relevant information.
Some days ago I came across a video (I guess that was your or maybe Nick Chapsa video) that was using blazor to create html template and then send on email or print as pdf. If was your video then kindly put it's link to me cause I was not able to find.
And I have a question regarding that. I have a microservices architecture web apis, is that a good practice to create a separate project of blazor and create dynamic html template and send in email, or print as pdf? I want to avoid using libraries?
I don't think I made something like that
Is razor view is enough to build UI in large application instead of react Or angular? What’s your thoughts on this ?
Yes, Razor is pretty good. The "how it works" part is why most people go for SPAs
@ Razor Pages + HTML+ HTMX + AlpineJS . It’s works pretty well for partial rendering. Have you ever tried? Is it good to use these stack for large application ?
@@MilanJovanovicTech ?
Thank you for making these amazing videos! And, yes, I promise to stay 'awesome' until the next time)
This is the way 😁
Any good libraries for reading/parsing a PDF document to get the data out of it?
Other than IronPDF?
@@MilanJovanovicTechit seems that the reading is very basic, I don’t want all text, I want to be able to say get the text from this table cell etc
Sautinsoft.Document is a good one
can we it with blazor web Assembly
In theory, yes. I haven't tried it
I have a license that is about a year or two years old of IronPdf library, but when you deploy your applications it is a hassle because some libraries have to be installed in the server. So if you are deploying to Linux, you may run into an issue where these libraries don’t get installed and you need up creating symbols to match the version it needs, very painful.
Yeah, that part sucks
I don’t know if they have fixed this issue yet, but it also deploys all the languages. In the version I have there was no way to select what languages to deploy. It would just deploy everything. By the way I really like you share a lot of your experience. Thank you!
I can't decide, generate pdf in blazor wasm with the JsPdf library or generate in my webapi and view in blazor, the AI doesn't recommend me in the webapi due to traffic, friend, what do you recommend me to generate in the frontend or in the backend?. Greetings from Paraguay.
I forgot to mention that not all libraries work in Blazor Wasm
Do you need to just display it to the user? It's probably fine doing it in WASM
On a real project, which endpoint resource group (controller) would you put this route to generate those invoices?
/invoices
/invoices-report (As you've shown us)
/reports
Which routes / resources would you usually put those reports generations?
I have some "patterns" and thoughts around that, but I'd like to see your POV
/invoices/id/report?
/orders/id/invoice?
A few ideas
I have looked into IronPdf a lot, and even though they are fairly good, their Chrome identical renderer is not completely Chrome identical, and it is super expensive.
What did you end up choosing?
@@MilanJovanovicTech I ended up with a solution where I use RazorLight for templating, and then I use Browserless which exposes Puppeteer as an API to turn HTML into a PDF file. It works great, but it is a bit slow to render the HTML before it saves it to a PDF.
Where I work we needed the presision which HTML just can't provide, therefore we went with QuestPDF, and it have been great. Sometimes you can feel from the lack of options that it is a 1 man project, but the options you don't have available isn't something you can't make yourself. We also had some issues with an update, which broke support for linux for a few days. But after reporting the problem to the dev, it got solved rather quickly, and he also seem to be pretty responsive to questions and problems that come in, can only recommend.
We also tried IronPDF to see if it was good enough, due to its simplicity, but it wasn't due to the nature of html to pdf conversion. But if all you need to do is print out invoices and money isn't an issue, it is very simple to setup.
Interesting. What was your use case that HTML couldn't solve from a precision standpoint?
There's always the risk of betting on a one-man project, though.
can we use it in a ClassLibrary project
I'm confident it should work
Ual, sensacional!
amazing!!!!!!
Thanks! :)
Tem br por aqui também? Salve conterrâneo
What to do with fresh chapters
What do you mean by fresh chapters?
@@MilanJovanovicTech sorry , is stamp
Nice Video and approach but sadly IronPDF is very expensive. A good alternative is QuestPDF but that's C# code to PDF. What is also working is using Razor Components (not views)
QuestPDF is great library, I use it when I need to create PDFs, absolutely recommend it :)
As everything it depends. If you know you would have constant structure of pdf file, you can use quest pdf and try to format file with quest pdf c# code. But there are some business cases when you need flexibility in customizing file template without deploying new version of the application (multitenancy for example)
@@mateuszadamowicz770 yea i totally agree, that's why I mentioned that questpdf is c# code to pdf. It is more difficult to make flexible but has the same functionalities in generating the output pdf.
How to add fields to the PDF so the users can type in them?
QuestPDF is an excellent tool, I enjoyed it
how to make excel reports?
Bunch of excel libraries out there
Milan, Can you do a video on using options pattern with a custom provider, say a sqlite database?
That'd be interesting idea, adding it to my content list
@@MilanJovanovicTech Thanks, appreciate it.
I'm not convinced html -> pdf is good fit for this use case. This can be seen by the poor layout of multi page example at the end of the video.
Note that it wasn't a table, that's why
Well. such a interesting topic to cover and this time you video is just an ad :( 1. There are better 'paid' option: Syncfusion html to pdf with community license if you work for company with revenue under $1 million. 2. Quest PDF is such a great library to that a bit differentely. Lastly, you did not produced proper invoice document. No header, no page number, no nothing starting from page 2. Sorry ! I know you can do better, but you haven't in this video!
Sorry for not implementing a production ready solution in 15 min, I guess. 🤷♂️ But this is more of a proof of concept, that can be extended further.
As for the invoice structure, we can be nitpicky. It will depend on what you need to do. My invoices are way simpler than this, and I'm doing just fine. It doesn't have to be shiny.
I didn't know about Syncfusion, will check it out. QuestPDF would have taken much more code to pull something like this off, p)us there's a learning curve to the library. Most teams will have someone good with HTML that could extend the implementation I showed.
@@MilanJovanovicTech That's why I've mentioned syncfusion as it offers the same functionality. Using HTML table with / would not take longer than using divs but would've resolved a lot of issues. As a matter of fact, html table is the way to implement any kind of printed document ( official company's document ) and that should've been said as most important thing in the video no matter what tool it's being used to convert HTML to PDF. I agree that Quest PDF requires some practivce / kwnoledge.
Very expensive commercial product 👎
Developers are typically much more expensive 😅 That being said, what if it's the only solution to your problem? I bet you'd happily pay. Of course, it's an open market, and there are many other alternatives.
True. I have seen so many cases where the company did not want to pay for such a product and paid way more eventually by developing it themselves.
Is there anything come with no cost? We should support a good software that does the job well and help the business save the cost instead of writing some low quality and maintainable code to proof the existence of development.
@@MilanJovanovicTechwhile its an interesting tool, but you could have let people know about the licensing, first before continuing showing it off. For smaller projects not interesting, for hobby projects also not interesting; for bigger companies sure.
@@VincentYang024pdfsharp/migradoc
It is better to introduce the free ones😂
I think I'll do a blog post reviewing a few libraries.
@@MilanJovanovicTechwould love that 🎉
This and most solutions using (Razor) Views and models work best with fixed data structures. We have a solution that generates documents on structures where we don't know the fields, and don't know the content. The customer does know content and structure so we made our own field merging engine that can still be used with any type of template and is rendersed to pdf ultimately with EssentialObjects pdf (and just recently I added support for IronPdf as well). Our content could also generate export files with very variable length, and could even use several file based templates to generated compound documents.
Because of the nature of our "models" we cannot use the very nice Model support that Razor has. If anyone has any ideas on how to use Models with unknown datastructures, perhaps even anonymous types I would love some direction because we could remove a lot of complex custom code :-) and rely more on standard libraries
That sounds pretty cool. 😁
If it works don't try to fix it?
Just use seal report. It has payed converters but they are cheaper
Interesting, haven't heard of it
RazorLightEngineBuilder to generate html template
NReco.PdfGenerator to convert html to pdf
Never heard of RazorLightEngineBuilder, interesting.
D/M/Y is the only way! lol, you might have just started an issue, but I agree there🤜🏼
only accepted date format should be the ISO :D
anyways, no matter how you separate them, but we should keep going from larger units to smaller units as with every other thing in life. hours:minutes:seconds, millions,thousands,dollars.
This is the way!
cool
Thanks
Great video. It's good you are not a FE developer
Lol 🤣 Doesn't matter, my website still looks pretty decent. 😁
Please Make it with webapi and angular plz plz
I doubt that
I like yyyy/MM/dd way more. It can be sorted in a more meaningful way I think.
On the topic. Can be done using OSS, but the implementation is mostly forced upon the programmer. It's not as simple as just calling one static method. Especially page brakes are a pain in the butt. I would guess that IronPDF is using the Chromium engine under the hood. So you could basically create IronPDF yourself, but the amount of work you have to put into it... brotha
And the price for IronPDF is steep! Dayum.
Probably not worth doing it yourself 😅
Used DinkToPdf because its free
There are better free options
Kindly name some. That can run on the Linux production too. Because Linux does not support System.Drawing.dll