March 31, 2025
| 4 Min read
At Zomato, we love food and we love data. And sometimes, those two passions collide in the creation of beautiful, portable, and secure PDFs. From invoices and receipts to detailed reports, PDFs are a cornerstone of our operations and a staple across the industry. However, our existing PDF generation process, powered by a PHP-based library, was starting to show its age. We encountered latency issues, especially during the peak hours and the situation worsened with complex, multi-page PDFs that included significant graphical content.
We needed a solution that could sustain our growing demands – something faster, more efficient, and scalable.
In pursuit of a more tailored and efficient approach, we decided to develop our in-house PDF generation solution. We chose Go as our programming language, given its performance and our team’s familiarity with it.
For rendering, we leveraged Rod, a go library for controlling headless Chromium. For PDF signing, we integrated Go PDF (digitorus/pdf), allowing us to generate and sign PDFs directly from HTML templates. This approach gave us full control over layout, styling, and security.
To ensure the authenticity and integrity of our PDFs, we implemented digital signing using a custom certificate. This adds a layer of security and trust to our documents, which is especially important for sensitive information like financial transactions.
We’re always looking for ways to improve performance, and Espresso is no exception. We implemented several optimizations to make our PDF generation process as fast and efficient as possible:
We developed a small front-end application to accompany this system, allowing anyone at Zomato to create and customize PDF templates effortlessly. This tool empowers users to modify existing templates or design new ones from scratch, all while receiving real-time feedback on the appearance of their final PDF output.
Espresso isn’t just fast – it’s incredibly fast. Espresso has been successfully deployed across the majority of our PDF generation workflows, delivering consistently impressive performance metrics.
These numbers were witnessed when running espresso as an AWS ECS service with 4vcpu and 4G memory. This scaled to a hundred containers at peak load.
Espresso’s efficiency is truly remarkable. Compared to our prior system, it demands significantly less infrastructure, drastically reducing resource consumption. This translates directly into substantial cost savings, resulting in a 90% deduction in server costs for generating the same volume of PDFs.
10 AI Tools That Replace a Full Dev Team (Almost)
The Power of UI/UX: Designing for Better Digital Experiences
By Riya Jain
ok
By Raghav Sharma
Very Nice Content
By Raghav Sharma
Very Good
By Raghav Sharma
Nice Content
By Raghav Sharma
Very Good