๐ 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.
Features Showcase
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 / 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
โก Quick Start
Web Interface Access
PDF Viewer
Interactive template editor and PDF preview
Template Editor
Visual drag-and-drop template designer
PDF Filler
Upload and fill PDF forms with XFDF
Example Usage
Load Template via URL
http://localhost:8080/?file=temp_multiplepage.json