So, after 2 weeks of research we still don’t really have a solution. However, as with most of these libraries, they don’t support Linux directly! Page headers were simple and css was very well honoured. These are both reasonably priced, and in my test use case worked the best. Two libraries not mentioned above are HiQPdf and Winnovative. Wow! This completely ruled out IronPdf for us. IronPdf was one of the few libraries that seemed to completely ignore this style and would split a table row in half at the page break. If this is not crucial for you, then one of the wrappers for wkhtmltopdf could work very well, DinkToPdf is probably the best bet.Īnother crucial for us was that the css style “page-break-inside: avoid ” must actually work. Writing the header to a temp file and deleting afterwards smelled too bad for my liking. This eliminated any wkhtmltopdf wrapper library, since wkhtmltopdf only supports a header as a document or url. We therefore needed a library to convert Html strings or streams to Pdf documents.įor us, a crucial component was that we could specify the header in Html. We are using the Mvc razor engine for templating, and extract the Html directly from that. Aspose and Syncfusion pricing is simply crazy, so I have not even evaluated them. We are happy to pay for the license providing it is reasonable. I too have conducted similar research, also with disappointing results. But that being said, HTML Templating works so tick! Loading HTML from a string versus loading HTML from a URL was all mixed together and so when reading examples, you had to check the code example to see what it was actually used for. While documentation is pretty good, I found it sort of all over the place. In just a few lines we are up and running. But again, seems strange to only make this a tiny footer link and not sure it anywhere else… HTML Templating Doesn’t seem to be any limitation on commercial use. It seems like the only limitation is that you can’t generate PDFs over 5 pages. You can read more about the Community Edition here. Honestly I think that’s way more interesting as a business model, but the pricing again starts at $19 but goes all the way up to $449 a month so I can’t really see many people taking this option.ĮDIT : So weirdly enough, there seems to be a “hidden” free community edition that you can only find via a tiny footer link. Interestingly they do offer an online version where they can generate the PDF for you by sending a URL or HTML code. Licensing starts at $499 and goes up to $1599. It’s a paid library (Which made it all the more annoying they were commenting on stackoverflow answers with “Sure just use this great library called SelectPDF” and not mentioning the cost), But regardless I wanted to check them out and see what they offered. ![]() I got pushed to SelectPDF by a tonne of stackoverflow answers (Kinda felt like maybe they were astroturfing a little…). And it doesn’t have HTML rendering packaged (And the library that currently does extend it to do HTML templating also doesn’t support. NET Core which is probably going to be a blocker. So basically, in terms of a decent template engine out of the box, it’s a fail. There are ways around this using another library that extends PDFSharp… But that’s still another library that you have to grab and work with. I get it that this was what you had to do in the year 2000, but it’s just not going to fly right now. Gfx.DrawString("Hello, World!", font, XBrushes.Black, new XRect(0, 0, page.Width, page.Height), XStringFormats.Center) ![]() XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic) XGraphics gfx = XGraphics.FromPdfPage(page) So above else, I just want to be up and running in minutes, not hours. Whether it’s some C++ library converted to C#, a library that needs X number of other libraries to actually function, or things just plain don’t work how they should, I’m probably going to see it all. This is probably a pretty subjective one, but when you start seeking out libraries from the corners of the web or that stackoverflow answer from 3 years ago, you often end up getting some really half baked library that just doesn’t work. What I really don’t want to do is have to place each element manually on the PDF like we had to back in the day when printing a document from a WinForms application. HTML with some XSLT engine), but ideally I just want to feed an HTML file to the library and out comes my PDF. I was open to using some other reasonable alternative (e.g. I had already decided that I wanted to use HTML as my templating mechanism. ![]() ![]() Freemium is OK as long as the free version is actually useable. single pages only, set number of images allowed per PDF). If there is some sort of freemium model in play, then I also wanted to make sure that the limitations weren’t too crazy (e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |