Open Source Go Library for PDF Document Generator

A minimalist PDF generator Go API that allows the developers to manipulate PDF Documents.

One File PDF is and open source PDF generationg API for GO. Its is an minimalist and lightweitht PDF manipulation API. The main theme behind developing this API was to make and GO API as short as possible to cover 80% PDF document generation needs. The small size of the API allows the developers.

The API provides wide range of document genreation features for generating common business report. You can insert text, set font speficy color, set columns, draw rectangles, circles and ellipses and insert JPEG, GIF and PNG images in PDF file. Furthermore, the API allows setttign metadata properties of PDF document including author, creater, keywords, subject and title.


Previous Next

Getting Started with One-File-PDF

To install the One-File-PDF on your system, please run the following command.

Install One-File-PDF via GitHub

go get

Generate PDF Document via Free Go Library

Generating PDF documents with Go is pretty simple. All you need to do is create a blank PDf document with A4 size by using pdf.NewPDF("A4") method of the API. You can set measurements of the doucment in centimeters using pdf.SetUnits("cm") method and Similarly draw grid in newly created PDF document using pdf.DrawUnitGrid() method.

Set Font in PDF using Free GO API

This lightweight open-source API allows basic document manipulation and genration operation for PDf document. Once you have create a new document, you need to set font and font styles. In order to set fonts, pdf.SetFont() method, set position using pdf.SetXY() method and color of the text using pdf.SetColor() method respectively.