# GoPDFSuit turns JSON templates into PDFs without a hosted service

> GoPDFSuit is a PDF engine shipped three ways: a REST API, a Go library and Python bindings over the same core. Templates stay in readable JSON, the engine runs in memory, and PDF/A-4 compliance is where the cost shows up.

**chinmay-sawant/gopdfsuit** — GoPDFSuit - Ultra Fast PDF Engine (Gin Web + gopdflib +pypdfsuit)

- Repository: https://github.com/chinmay-sawant/gopdfsuit
- Website: https://chinmay-sawant.github.io/gopdfsuit/
- Stars: 607 · Forks: 37
- Language: Go
- License: MIT
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/chinmay-sawant-gopdfsuit

## One engine, three ways to call it

GoPDFSuit is not a single program, it is one engine published in three shapes, and the repository makes the choice explicit. The gopdfsuit component is a language agnostic REST API that runs as a service and can be called from Go, Python, JavaScript or curl. The gopdflib component is a Go library you import directly into a project. The pypdfsuit component is Python bindings, described in the project overview as a CGO wrapper around gopdflib.

That structure is the reason to pay attention. The same engine, the same template format and the same compliance features are reachable from three directions, so a Python shop and a Go shop can both adopt it without one of them wrapping the other.

The motivation is stated plainly in the readme. The author was tired of hosted PDF services that charge per page and hide the layout logic, so the design keeps the template in JSON where it can be read and the engine runs in memory with no Ghostscript and no external calls.

One detail about the repository layout is worth knowing before you follow a documentation link. The documentation index notes that documentation/ holds the current pages while guides/ is a frozen archive, so an older link that points into guides/ may describe behaviour that no longer holds.

## JSON in, PDF out, and the compliance toggle that changes the cost

The input is a JSON template and the output is a PDF, with page breaks and flow handled across pages. The engine overview describes the in-memory pipeline as decode, render, fonts, tagging, XMP, sign and encrypt, which is a useful list because it names the stages where extra work is optional rather than mandatory.

The features that matter for production paperwork are grouped under security and compliance: PKCS#7 and X.509 signatures, AES-256 encryption, granular permissions, and PDF/A-4 with PDF/UA-2 when you opt in. Beyond that there is text styling, tables, barcodes, QR codes, SVG vector graphics and interactive forms with checkboxes and radio buttons.

The opt-in wording is the important part. The project's own benchmark table shows what compliance costs, and it is not a rounding error. On the reference workload, which the readme describes as 5000 iterations with 48 workers and a mix of retail, active and HFT traffic, the compliant harness reports a peak of 6,611 ops/s and a mean latency of 7.54 ms, while the non-compliant harness on the same workload reports 37,853 ops/s peak with 1.38 ms average latency.

The compliant path turns on PDF/A-4, PDF/UA-2, Arlington compatible tagging, ECDSA P-256 signing and font embedding. The non-compliant path still emits PDF 2.0 but skips PDF/A, tagging, signing and font embedding. The readme says this is the throughput ceiling, and it says the compliance tradeoff is real rather than hiding it.

## Adding the Go library and generating a first page

The Go path is a module dependency pinned to a version, and the module path carries a major version suffix.

```bash
go get github.com/chinmay-sawant/gopdfsuit/v7@v7.0.0
```

The import follows the same path shape, and the usage is a builder that produces bytes.

```go
import "github.com/chinmay-sawant/gopdfsuit/v7/pkg/gopdflib"

b := gopdflib.NewDocument("A4", true)
b.AddTitle("Hello", gopdflib.WithTitleFontOpts(gopdflib.TitleFontOptions{Name: "Helvetica", Size: 18, Bold: true}))
pdfBytes, err := b.Generate()
```

The two arguments to NewDocument are the page size and a boolean, and the readme does not spell out the second one in the snippet itself. The fluent style is available as well, with Font, Size and Cell chained in pkg/gopdflib, and the Python side mirrors it through TemplateBuilder. Two separate documents describe that mirror work, a builder fluent guide for Go and a parity document for the Python builder.

The module file pins the language level too.

```
module github.com/chinmay-sawant/gopdfsuit/v7

go 1.26.4
```

Requiring a recent Go release is a real constraint for teams on a frozen toolchain, and it applies to all three surfaces, not just the library.

## The Python bindings are built locally before they are installed

The Python package is not published as a wheel you can install directly. The quickstart sends you into the bindings directory, runs a build script and then installs the result, which is the usual pattern for a CGO based binding where the native library has to be compiled first.

```bash
cd bindings/python && ./build.sh && pip install .
```

Once installed, the API mirrors the Go builder closely enough that the same document can be written in either language.

```python
from pypdfsuit.builder import TemplateBuilder, Font

b = TemplateBuilder("A4", True)
b.add_title("Hello", font="Helvetica", size=18, bold=True)
pdf_bytes = b.generate()
```

The snake_case method names against the Go camelCase ones are the visible difference, and the parity document exists precisely because that mapping has to be kept in step over time. For a Python team, the practical cost of adoption is the local build step and whatever CGO requires on the build machine, not the API design.

The readme also points at a separate WASM frontend described as a local-first browser app with its own artifacts, consent and offline notes, which is a fourth way to reach the engine if your browser is where the template actually lives.

## Running the REST API from a container on port 8080

The service surface is the one to reach for when the caller is not Go or Python. The readme gives a container start command and a curl call against the template endpoint.

```bash
docker run --rm -p 8080:8080 chinmaysawant/gopdfsuit:7.0.0
curl -X POST http://localhost:8080/api/v1/generate/template-pdf \
  -H "Content-Type: application/json" \
  --data-binary @template.json --output out.pdf
```

The port mapping is explicit, the image is tagged with the release version, and the request body is the JSON template read straight from a file with --data-binary, with the PDF written to out.pdf.

The endpoint namespace is /api/v1, and the REST documentation is described as covering every endpoint with curl examples, authentication, an error envelope and the caps that apply to each operation. Authentication is worth reading rather than assuming, because the repository carries a separate QUICK_AUTH_REFERENCE.md file and a setup-auth.sh script at its root, which suggests that auth is a configuration step rather than a default.

Sample payloads live in sampledata/, and the samples catalog lists every directory in it together with the command to run each one, so the fastest way to learn the template format is to run an existing sample rather than to invent one.

## The hosted service is the alternative, and the difference is where the template lives

The obvious alternative to GoPDFSuit is a hosted PDF API, and the readme describes the objection to it directly: those services charge per page and hide the layout logic. The difference in approach is about who owns the artefact.

With a hosted service, the template lives in the vendor's format or in a request body, the pricing model is per page, and the layout rules are the vendor's implementation. With GoPDFSuit, the template is JSON in your repository, the engine is a dependency or a container you control, and the same template can be exercised from a Go unit test, a Python script or an HTTP call without changing.

That matters most where the PDF is part of a regulated or high volume process and where per page billing is a real cost line. The readme also names the trade-off honestly in the other direction: compliance output is slower than non-compliant output, so the same engine can be either fast and non-conformant or slow and conformant depending on which switches you set.

The project also leans on the open source ecosystem for the underlying pieces. The module requirements include a fork of wkhtmltopdf, and the go.mod file pulls in PDF rendering, font and typesetting libraries such as freetype, canvas and font, along with goldmark for Markdown and knuth for typesetting. The generator is assembled from those parts rather than delegating to an external converter binary, which is what makes the in-memory promise possible.

## MIT licensed, versioned releases, and a fast moving major line

The licence is MIT, and for a PDF engine that ships as a library, a server and a Python package, that keeps the adoption conversation short.

Releases move in major steps rather than patch cadence. v5.0.0 landed on 2026-03-10, v6.0.0 on 2026-06-23 and v7.0.0 on 2026-09-06. The repository is not archived and the last push was on 2026-09-08, two days after the v7.0.0 tag, so the release and the source are close together. The consequence for adopters is that a major version bump changes the import path, since the module is versioned as github.com/chinmay-sawant/gopdfsuit/v7, and a bump means editing imports and pinning a new tag.

The documentation set is unusually complete for a project of this age, with separate guides for the REST API, the Go library, the Python API, compression tiers, HTML conversion, document operations, the WASM frontend, compliance and benchmarks, and the template reference. The compliance and benchmarks page is also where the bench commands are documented, which is the page to read if you intend to reproduce the numbers quoted in the readme rather than take them on trust.

## Conclusion

GoPDFSuit fits teams that need programmatic PDFs with the layout kept in a template file they can read and review, especially where a hosted service's per-page billing or opaque logic is the problem, and where Go 1.26.4 is already your toolchain. It is a poor fit if you need compliance-grade output at maximum throughput, since the project reports compliance work at roughly a fifth of the non-compliant rate, or if your language is neither Go nor Python. Check first that the v7 module path matches your imports, that your templates and samples under sampledata/ run against the version you pin, and that the compliance features you need are actually switched on rather than skipped.

## FAQ

### How do I install the GoPDFSuit Go library?

Run go get github.com/chinmay-sawant/gopdfsuit/v7@v7.0.0 and import github.com/chinmay-sawant/gopdfsuit/v7/pkg/gopdflib. The module path carries a v7 suffix, so a major version bump means changing the import path.

### How do I run GoPDFSuit as a REST service?

Start the container with docker run --rm -p 8080:8080 chinmaysawant/gopdfsuit:7.0.0. The server listens on port 8080 and template PDFs are posted to /api/v1/generate/template-pdf as JSON.

### Does GoPDFSuit need Ghostscript or a hosted PDF service?

No. The project states the engine runs in memory with no Ghostscript and no external calls, and the JSON template stays in your own repository where you can read the layout logic.

### What Go version does GoPDFSuit require?

The go.mod file declares go 1.26.4 and the readme badge names the same version. The requirement applies to the library, the bindings and the server.

## Sources

- [chinmay-sawant/gopdfsuit on GitHub](https://github.com/chinmay-sawant/gopdfsuit)
- [License: MIT](https://github.com/chinmay-sawant/gopdfsuit/blob/master/LICENSE)
- [Project website](https://chinmay-sawant.github.io/gopdfsuit/)
- [README](https://github.com/chinmay-sawant/gopdfsuit/blob/master/README.md)
- [Releases](https://github.com/chinmay-sawant/gopdfsuit/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/chinmay-sawant-gopdfsuit
