
It includes the code for getting the data for I'll show the full code for the PageModel class for the Razor page that

To "establish the best licencing model for you". Their site requires that you fill out a form and have a sales person contact you I have no idea what the cost of a commercial licence is. However, unlike the other two options, it is not freeįor commercial use. I should start by mentioning that, like the other two options, iText isĪlso open source software. The first two references bring in Bootstrap 5 and Bootstrap icons, while the final one brings in some rules that set the font to Open Sans and ensure that tables are broken nicely over multiple pages. It includes references to local CSS assets using relative paths: The contents of the partial is essentially a complete HTML5įile. Rendering Razor partials to a string using the technique I blogged about Sources, including variously files, streams and URLs). a free open source project that does well in searches relating to PDF fromĬhromeHTMLToPdf - another free open source option.Įach option can generate a PDF file from a string of HTML (as well as other

ITextSharp library that I'm familiar with IText 7 - an up-to-date replacement for the I decided to have a look at three different options: See the source code on Github if you are interested. The header and the logo are placed in aĪnd positioned using the justify-content-between CSS The colour of the icon in these instances is controlled by the It also uses Bootstrap icons to indicate whether items need to be reordered. Discontinued items are displayed using the text-black-50Ĭlass from bootstrap 5.

To apply alternative backgrounds to table rows. The table uses the table-striped CSS class (Open Sans from Google Fonts) within the PDF. The design makes use of Bootstrap 5 CSS and icons. The PDF content is a report consisting of table of data from aĭatabase. For this exercise, I only want to generate a PDF.
