5 ms·
I recently used this to create a language agnostic tool that generates reports in an unified format for two different services. Can't say it's completely painl
by mixedCase 9y ago
I recently used this to create a language agnostic tool that generates reports in an unified format for two different services.
Can't say it's completely painless due to the imperative nature of the API but it served me well. If you're reading this, thank you maintainers!
- swah 9y agoDo you what one would use to generate professional looking report PDFs?
- anonfunction 9y agoIt's not a Go program but Microsoft Office or Apple's equivalent can make "professional looking" reports you can export to PDF. You could also use Photoshop if you want to be more creative or LaTeX if you're going for a minimalistic look.
- swah 9y agoI meant programmatically customizable "reports" like invoices with charts. Sorry I didn't mention.
- mappu 9y agoShell out to wkhtmltopdf.
- nyir 9y agoJust to say, we did this and it looks pretty good, most importantly though the templates including any JS if necessary makes this _very_ easy for designers to work with on their own. Downside is that the browser is pretty old.
- osrec 9y agoThe quality of the report depends significantly on the designer. I've seen some very good looking documents generated client side with pdfmake (JavaScript). In my SaaS product (link in profile), we generate PDF invoices with it, and they look very professional. It's a bit painful to get things typeset correctly, but once you have it right, the documents look great. pdfmake is a good option if you don't want to load your server CPUs up with generating PDFs...
- deleted 9y ago[deleted]
- mixedCase 9y agoThis worked quite fine and the output is more than satisfactory. We were looking to replace both a slow interpreted PDF renderer and a Webkit-based solution, the first one not up to our standards and the second one too much of a security gamble for the nature of the project. I wouldn't recommend it however if your design is complex, you're on a very tight schedule and you can stomach Webkit. Truth is Gofpdf requires careful coding and testing to make sure you're drawing things in the right places. You draw using simple primitives positioned around the page with a "cursor"; not something that lends itself to pumping out flashy results in little time.
- nathan_f77 9y agoYour second paragraph is exactly why I built FormAPI [1]. We have a UI to position form fields, so you don't have to do everything in a text editor. (We also have an HTML/CSS editor to create your own templates.) [1] https://formapi.io/templates/mr4ekGhgZTptdQaN/edit https://formapi.io/templates/mr4ekGhgZTptdQaN/edit
- JelteF 9y agoLatex is very easy to generate from any programming language, because it's just text. I created a Python package for it with an easy and extensible API: https://github.com/JelteF/PyLaTeX https://github.com/JelteF/PyLaTeX If you want to create something similar, be sure to escape untrusted input though. With an escape function similar to the one in my library. Otherwise it's very easy for an attacker to execute arbitrary commands.
- exhilaration 9y agoWe're mostly web developers so we designed our complex shipping invoices in HTML and ran them through DocRaptor's API https://docraptor.com https://docraptor.com for many years with beautiful results at a reasonable cost. Eventually other teams in our organization started doing the same so we paid a few thousand bucks for the package DocRaptor uses in the backend https://www.princexml.com https://www.princexml.com and run it locally.
- nathan_f77 9y agoI've built a SaaS service that generates PDFs, and I've just added an HTML/CSS editor for this purpose [1]. It uses Liquid templates and SASS. After you set up all of the fields, you can just post data to a simple API. We also provide an online form that people can fill out. If you just need to post your own HTML/CSS and get a PDF, then I'd recommend DocRaptor [2]. [1] https://formapi.io/templates/tpl_mFAsZEmhCtG9FX5N/edit https://formapi.io/templates/tpl_mFAsZEmhCtG9FX5N/edit [2] https://docraptor.com https://docraptor.com