๐Ÿ“„ GoPdfSuit Documentation

๐Ÿ“„ GoPdfSuit Overview

A powerful Go web service that generates template-based PDF documents on-the-fly with multi-page support, custom page sizes, automatic page breaks, and comprehensive form filling capabilities. Built with Go 1.23+ and featuring a modern web interface with dark/light theme support.

Template-based PDF Generation

Create professional PDF documents from JSON templates with automatic page breaks, multi-page support, and intelligent height tracking.

Modern Web Interface

Interactive HTML viewer with real-time preview, syntax highlighting, dark/light themes, and mobile-responsive design.

Advanced Tables & Forms

Support for complex table layouts, checkboxes, AcroForm filling, and font styling with automatic page flow and border controls.

Flexible Configuration

Custom page sizes (A4, Letter, Legal, A3, A5), orientations, borders, watermarks, and comprehensive template structure.

Rich Typography

Bold, italic, underline text support with 3-digit style codes, custom font sizes, alignments, and flexible positioning.

Security Features

Path traversal protection, input validation, JSON structure validation, and secure file handling for production deployments.

๐Ÿ—๏ธ Architecture

Go Backend

Built with Go 1.23+ using Gin framework for high-performance HTTP handling

Modular Structure

Clean separation: handlers, models, PDF generation, and web assets

In-Memory Processing

Fast PDF generation with height tracking and automatic page management

Go 1.23+

Built with modern Go and Gin framework

Fast

In-memory PDF generation with auto page breaks

Secure

Input validation & path traversal protection

Self-contained

Single binary deployment with embedded assets

๐Ÿ” GoPdfSuit vs Licensed PDF SDKs

Comparison of features and benefits. GoPdfSuit is FREE and Open Source (MIT). Sample test data is available in sampledata/json (results may vary by machine).

Feature comparison: GoPdfSuit vs Aspose / iText / UniDoc
Feature / Tool GoPdfSuit (MIT) Aspose (Proprietary) iText (AGPL / Commercial) UniDoc (Commercial)
License / Cost MIT โ€” Free & Open Source Commercial โ€” per-developer / per-server pricing AGPL (open) or Commercial license for closed-source use Commercial tiers (Business / Gold / Platinum)
In-memory generation (speed) โœ… In-memory โ€” millisecond-scale generation (JSON templates, local tests) โœ… High-performance enterprise generation (varies) โœ… High-performance, depends on integration โœ… High-performance, optimized SDK
Template-driven (JSON) โœ… Native JSON templates for fast authoring โŒ Typically API/SDK-based, not JSON template-first โŒ API/library-based (templates via code) โŒ SDK / API-based (code-first)
AcroForm / XFDF filling & appearance โœ… XFDF filling (heuristic injection). Appearance may rely on viewer (/NeedAppearances). Fill up to ~12ms in local tests. โœ… Full AcroForm support + appearance stream generation โœ… Full AcroForm & appearance control via API โœ… Full support; commercial appearance handling
Appearance streams / viewer compatibility Limited โ€” best-effort; some viewers may regenerate appearances Full support โ€” appearance streams generated reliably Full support via API Full support (enterprise features)
Deployment Single binary, no external runtime required Library or service; commercial deployments supported Library for integration; commercial options available SDKs with enterprise deployment options
Support & SLA Community support (GitHub issues) Commercial support and SLAs Commercial support available with license Commercial support with tiers and SLA

Endpoint performance (developer environment)

Endpoint Avg latency (ms) Max latency (ms) Notes
POST /api/v1/generate/template-pdf 1.0285 1.4204 Logs: 1.4204ms, 636.5ยตs
POST /fill ~12 12 Max observed in developer environment (single sample)

Times measured on developer machine; results vary by hardware. Times are shown in milliseconds (ms).

๐Ÿ”ง Installation

Requirements

  • Go 1.20+ (project currently targets Go 1.23)
  • Dependencies: Automatically managed via Go modules

Installation Steps

1. Clone the Repository

git clone https://github.com/chinmay-sawant/gopdfsuit.git
cd gopdfsuit

2. Install Dependencies

go mod download

3. Run the Server

# From repository root
go run ./cmd/gopdfsuit
Server Running: ๐ŸŒ Server listening on: http://localhost:8080

โšก Quick Start

Web Interface Access

Example Usage

Load Template via URL

http://localhost:8080/?file=temp_multiplepage.json