7 ms·
Generating PDF invoices using Lago
- AnhTho_FR 4y agoGenerating a custom PDF is just such a pain. You don't know it before you tried to do it. I've seen Anvil (a YC co) is building a product dedicated to this challenge, check it out!
- wutwutwutwut 4y agoI wrote some C# code a couple of years ago to generate PDF invoices. Has been running fine since then generating tens of thousands of PDFs. It was pretty straight forward back then, only annoying thing were page breaks when there were a lot of line items, but apart from that I would not consider it a "pain". What issue have you had? What do you mean by "custom"?
- AnhTho_FR 4y agoYou're right, per se generating a small number of PDF is indeed easy. What's complex is: - Dynamic PDFs: you're trying to digitize a government process for instance, by launching online forms with a variety of user paths for the answers and generating a PDF with the answers that still fits specific government requirements - Doing it at scale
- jdenquin 4y agoThe pain in there is that every time you want to have a PDF generation system, you have to do the same stuff, it's not "complex" at all, but it definitely takes time, whatever the technology you use. On my experience, having ten thousand PDF generating at the same time was a very high load for our infrastructure and the cost was enormous, that is one of the main thing I'll focus on today : the scalability of it. It also depending on the way you create your template, hard coded with pixels or HTML!
- ranger_danger 4y agoI just use headless chromium to "print" a generated HTML page as a PDF, works great.
- jdenquin 4y agoLago actually use Gotenberg, it's very nice to manage the headless chromium state without any headache!
- Rafsark 4y agoDid you face any implementation difficulties with your solution?
- rudasn 4y agoNot parent, but if you need headers and footers on each printed page you need to make use of tables.
- simonw 4y agoMy shot-scraper CLI tool has an option that can do exactly that: https://shot-scraper.datasette.io/en/stable/pdf.html https://shot-scraper.datasette.io/en/stable/pdf.html shot-scraper pdf myfile.html -o output.pdf
- a9h74j 4y agoAFAIK uses wkhtmltopdf underneath. Saw a post suggesting Chrome browser developers would prefer not to be offering thin cli support -- presumably for such use cases to use wkhtmltopdf directly.
- ranger_danger 4y agoIt doesn't, and AFAIK they reversed that decision.
- lloydatkinson 4y agoIf you're OK with paying ~£0.05 per PDF you can just use Adobe's PDF API where you supply a word document with {{ name }} like variables in it and a JSON file and you get back a PDF with it all filled in. This way you just change the styling and layout with a word editor.
- hathawsh 4y agoIf I needed to generate PDFs, I would use ReportLab[1]. The core is open source and there's a great company behind it. The product appears easy and mature. What am I missing? 1. https://docs.reportlab.com/ https://docs.reportlab.com/
- kdeldycke 4y agoI have PTSD from 20 years ago trying to convert OpenOffice documents to PDF with ReportLab. It was janky because all elements had to be positioned in absolute coordinates to the virtual page. Nowadays I'll go straight to https://weasyprint.org https://weasyprint.org to produce PDFs in Python. That's what I used for https://scaleway.com https://scaleway.com invoices.
- zzo38computer 4y ago> Generating a custom PDF is just such a pain. You don't know it before you tried to do it. I never had any problem generating PDFs by using Ghostscript.
- rascul 4y agoI recall using cups to print to a pdf in the past.
- thibo_skabgia 4y ago
- AnhTho_FR 4y ago
- ranger_danger 4y agoOpen source backend when?
- jdenquin 4y agoall the Lago's api, what we call backend is open source, you can check it out there https://github.com/getlago/lago https://github.com/getlago/lago
- AnhTho_FR 4y agoWhat do you mean by "backend" ?
- webmobdev 4y agoBackend: Software application(s) that run on the server that provide the service.
- AnhTho_FR 4y agoThank you so much for the definition, to clarify: as the API is already open source, see above comments, I was asking what else was requested / missing.
- webmobdev 4y agoAPI just defines how another software can connect and interact with your software application. An API being "open" just means that the documentation of the way to connect and interact through an API is publicly available. The "Open Source" terminology however applies to source code of a software. If someone claims an API is "open source", it means the source code of the application providing the API is publicly available. In this case, the API is offered as a service and the software application that actually exposes and executes the API is on a server. That is why people are asking if the API is open source, where is the source code of the backend. Edit: I can see now that someone has posted a link to the repository of their backend / API source code too. Many must have missed that earlier, and hence the query.
- phkahler 4y agoThis isn't Open-source. This is a (currently) publicly accessible API.
- FVYPblNGl7R9ZAc 4y agoI only did a cursory look but it looks like the backend for the API is on their Github licensed under AFGL. https://github.com/getlago/lago-api/ https://github.com/getlago/lago-api/
- AnhTho_FR 4y agoIt's AGPLv3 licensed indeed!
- dougk16 4y agoCool idea, I can see how this would be useful once you're dealing with more than a few invoices per month. For those like me that do indeed only send out a few a month, I've found the Numbers app on Mac to have a very nice invoice template that you can customize, fill out, and generate a professional-looking invoice from.
- longrod 4y agoNot sure this actually solves a real problem. A lot of the questions/problems mentioned in the article are already things being addressed by any service worth using. At the end of the day, you just need to generate a PDF from a template. The template is a solved problem. Invoices generally do not have that huge amount of variability in terms of layout. I have been using microinvoice (https://github.com/baptistejamin/node-microinvoice https://github.com/baptistejamin/node-microinvoice) for the past couple of months and it's been a breeze. It uses PDFKit underneathe and has been working really well. I don't think PDF generation is a task that should require using Chromium. There's pandoc & other libraries that can easily do this at a much lower cost to both resources and finance. The blog posts sounds like its solving a problem that doesn't exist. Generating invoices _at scale_? Is scalibility really a problem here? Generating a PDF takes a couple of milliseconds. Rent a $5 VPS and it can generate all sorts of PDFs for you without an issue for a long time before you'd start worrying about scalability. Heck this sort of thing doesn't even need to be a dedicated service. Not to downplay anyone's hard work but Lago just doesn't sound like it's solving a real problem.
- AnhTho_FR 4y agoLago founder here. FWIW we love what Baptiste did with Microinvoice! I can only speak for what we've experienced first hand, in our prev. company (a $5B B2B fintech) we spent a lot of time around billing x invoicing in pdf : - When billing is complex (lots of fees, different billing cycles, usage based consumption) - And you need to have a clear "invoice presentation" to avoid triggering questions (that is maintained while you iterate on pricing, launch new products or countries) the "template isn't really a solved problem", and our eng. team did rebuild the system in-house. We would have avoided it if it could have been possible and looked at every possible option, in-depth. We've seen similar needs for marketplaces or vertical saas as well. However thanks for the feedback, we could have done a better job at explaining why it can be a pain in specific use cases! And I was the 1st person to say, when I first discover the painpoint "there must be an existing solution for that, please don't build anything in-house".
- longrod 4y ago> When billing is complex (lots of fees, different billing cycles, usage based consumption) So does Lago have a template for all these use cases? What happens when a new unique case comes up? Is Lago flexible enough to handle all the cases? Current and future ones? How is that different than having a flexible template? What actually is the problem with that?
- mellosouls 4y agoActual title: Generating PDF invoices using Lago
- Rafsark 4y ago@mellosouls love you title also!
- deleted 4y ago[deleted]
- 2Gkashmiri 4y agohey. does anyone know of a foss/open source project that does invoice template designing? there are tools that let you customize an invoice in its print form wyswig and allowing to use/export as pdf. t
- rad_gruchalski 4y ago12 years ago, I was working on a contract for an aircraft spares supplier. One of the hard requirements: all sales invoices, purchase orders, quotations, invoices, and so on, had to be printed AND available as PDF. The solution was to use JasperReports. The business could design their templates in a iReport Designer, test with dummy data, put the jrxml templates in a dedicated storage, and a simple http call would merge the real data with the template in a java service (200 lines of code) resulting in a PDF. That PDF would then get printed using ColdFusion cfprint (those huge multi-source laser printers with 10 different drawers). It was worth spending £800 for CF just for the cfprint stuff. Hundreds of these were printed and generated every day.
- kdeldycke 4y ago> had to be printed AND available as PDF. You just reminded me of a customer I was working for as a junior ERP consultant. They required us to have the proof a document was printed by a user. I went far down the rabbit hole trying to come up with an end-to-end solution involving cryptographically signed messages sent to the printer, a physical QR code on the document to be scanned back for validation, and others convoluted half-backed contraptions. But I couldn't find an unhackable way to reconcile the state in the machine with the reality of the physical world. A senior consultant solved it in 10 minutes. Showed them. They were ecstatic and we were paid. What has he done? Just updated a "printed" column in the database to "True" when the user clicked the HTML "print" button.
- rad_gruchalski 4y agoIn this case, the business owner would go through every printed document that landed on his desk. He really did, every day… it had to be printed, otherwise it did not exist. Regardless what we think about it, the man was driving a Zonda and his garage has seen a couple of Koenigseggs, and I still build software.
- kdeldycke 4y agoSounds like he had some sort of business discipline. Or worse, couldn't delegate and had to double-check everything by hand. Paper was his medium of choice in which he felt productive for this particular task. In my case I'm pretty sure the owners didn't care about the printed documents and never checked them. It was just required to have a proof because... process. That's when I understood ERPs were not about software but workflow. Not a solution either, but a symptom. Some requirements are bullshit, because nobody has the time (or mandate) to question the sacred Process. I quit doing ERPs not long after that.