Printing Webpages to PDF (HTML to PDF)
Read how SailSys, a leading sailing club management tool, moved to Gaffa to print web pages to PDF for reports using our automated browser API
Jan 15 2025
Customer Stories
SailSys, a leading sailing club management service used by some of the largest clubs in the world, is using Gaffa to generate PDF race results for club noticeboards. By switching to Gaffa, SailSys was able to reduce costs by 20% with minimal effort, and all without the complexity of maintaining infrastructure like headless browsers and queuing systems.
We built Gaffa to provide a simple and powerful way to control web browsers at scale for AI automation. One of its features is the BrowserRequest API, which amongst much more, allows you to print web pages to PDF documents and download them.
SailSys is a leading provider of software for sailing clubs to manage their sailing races and events. Within the product, club administrators can export race results as PDFs for displaying in the club house. SailSys uses a private web app (hosted on Netlify) which generates and displays the reports. Before Gaffa, SailSys had integrated an HTML-to-PDF API to load the site, wait for the page to load, and then capture it to a PDF which was subsequently downloaded and saved into their system. The launch of Gaffa provided an opportunity to switch providers and access the same feature set at a lower cost.
Gaffa Integration
The web page data that SailSys wants to capture in their PDFs loads asynchronously into a table, shown below. To ensure all the data is present at capture time, they wait for the table element to appear, rather than using a fixed delay which could unnecessarily slow down the process or be unreliable if the system responds more slowly than expected.

SailSys’s report site: a simple table element which appears once the site has made a request to the backend.
When using Gaffa’s Browser Request API, this is really simple. We just need to use two actions:
- Wait - tells Gaffa to wait until a given CSS selector or XPath appears on the page or for a defined period of time, in this case we set it to table. We can also supply a timeout value which prevents the browser request hanging indefinitely if the table fails to appear (perhaps for example, due to a system outage), if this time elapses without a table appearing, an error will be returned.
- Print - tells Gaffa to print the page to a PDF and accepts parameters for the page size (”A4”), a margin (”20px” - an average size for printing) and an orientation (”portrait”), this action will return an output – the url of the printed PDF of the page which is then ingested into the SailSys system.
The simple two-step browser request looks like this:
Gaffa Print to PDF Request
And returns the printed PDF in couple of seconds:
Gaffa Print to PDF Response
SailSys is built with .NET so integrating these requests using RestSharp took only a few minutes and the system was then seamlessly switched over to using Gaffa without any other changes to the codebase (the C# code can be found here). With Gaffa's generous starter plan, SailSys was able to reduce expenses on PDF printing by 20% and still has plenty of room to grow without incurring any extra costs.
Gaffa is capable of much more, but we hope this quick demonstration shows how you can integrate our API to export PDFs from your web application quickly and easily, without worrying about hosting your own headless servers, pipelines, or scaling - we’ll handle that all for you.
Start using Gaffa today or contact us to discuss your project’s specific requirements!
Appendix:
- Read more about printing to PDF in the Gaffa API docs
- Try sending a request to export a PDF from a site using the Gaffa API playground