5 ms·
I'm currently building an open source (not copyleft) PDF library for.NET standard [0] and I'd be interested to hear more what you need on the document generatio
by UglyToad 7y ago
I'm currently building an open source (not copyleft) PDF library for.NET standard [0] and I'd be interested to hear more what you need on the document generation side.
The current generation API for my library is extremely limited because I've never needed one but you are the perfect market research participant. It's an API I'm actively looking to improve.
PDF/A compliance is probably quite a way off though.
[0]: https://github.com/UglyToad/PdfPig https://github.com/UglyToad/PdfPig
[1]: https://github.com/UglyToad/PdfPig#document-creation https://github.com/UglyToad/PdfPig#document-creation
- merb 7y agowow that looks really nice. actually we mostly do html to pdf, but maybe I can look into your project and try to add it (if there is a nice html/dom library like java has with jsoup). basically we don't need a lot, mostly switch fonts/text sizes/images (generated barcodes, logos) and of course pdf/a-3(a/b/u) for invoice. so apis that translate the html into the layouting of pdf is the bigger problem.
- UglyToad 7y agoThank you for the response. Yeah HTML to PDF is a tricky one, presumably wkhtmltopdf/pechkin doesn't work out because of licensing / interop issues? Other than that the only other one I'm aware of is Aspose which is expensive as you say. Images (along with font subsetting and fixing the gzip implementation) are the next thing I plan to implement so it's helpful to know its a real requirement.
- merb 7y agoactually wkhtmltopdf/pechkin both won't support pdf/a-3 and have a not so nice output. aspose is actually really cheap, compared to others, unfortunatly their support is trash: https://forum.aspose.com/t/html-to-pdf-pdf-net-fonts-error-on-macos/198233 https://forum.aspose.com/t/html-to-pdf-pdf-net-fonts-error-o... i.e. pdf/a-3 does not work on mac (didn't tried linux, but I guess it has similar problems) btw. itext is a really great library, unfortunatly itext has a problematic licensing and I tought they were jocking after they gave me prices.
- numo16 7y agoFor html/dom parsing, I would recommend looking at either AngleSharp[0] or HtmlAgilityPack[1], as they tend to be the most popular in the community. [0]: https://github.com/AngleSharp/AngleSharp https://github.com/AngleSharp/AngleSharp [1]: https://html-agility-pack.net/ https://html-agility-pack.net/
- SamuelAdams 7y agoIn the past I have frequently needed to merge several existing PDF's together. The idea is this: we have a list of objects Foo in a grid that is available to an end user. Each Foo item has a PDF that can be printed - some of our users really like to just look at the paper print out of everything. So we created a "bulk print" option. They tick a bunch of checkboxes for the Foo items, then click the Print button. Internally we merge all those PDF's together and send one print job to the printer's queue. We used DevExpress [1] to accomplish this, and it worked very well. The only problem: it's expensive. Multi-billion dollar companies don't mind paying the price tag, but smaller shops sometimes think twice. If a free or near-free alternative existed, that would be fantastic. [1]: https://github.com/DevExpress-Examples/how-to-merge-documents-into-a-single-pdf-t114298/blob/17.1.3%2B/CS/PdfMergeExample/Program.cs https://github.com/DevExpress-Examples/how-to-merge-document...
- UglyToad 7y agoA large chunk of PdfPig started as a port of PdfBox (Java) , so it might be worth considering containerising or in some other way wrapping the PdfBox functionality to get Apache 2 licensed PDF merging [0] if this works for your scenario. It's useful to know that this is a real use case too, I always assumed it was implemented 'just because' but the scenario you describe makes sense. [0]: https://pdfbox.apache.org/docs/2.0.1/javadocs/org/apache/pdfbox/multipdf/PDFMergerUtility.html https://pdfbox.apache.org/docs/2.0.1/javadocs/org/apache/pdf... Edit: another option is this pdfium wrapper for NET Core though it merges one pair at a time: https://github.com/GowenGit/docnet https://github.com/GowenGit/docnet
- ThrowMeAwayOkay 7y agoI have a .NET Core web app that needs PDF creation abilities. Can I be your market research participant as well?
- UglyToad 7y agoOf course. Most of the current API focuses on data extraction because that was my area of work when I started the project but I think creation is the more common problem so its good to hear as many use cases as possible.