← PDF Server

PDF Server API v0.4.0

REST API for generating PDFs from HTML, CSV and JSON structured data.
Supports server-side QR codes, industrial 1D/2D barcodes, structured table reports, and dynamic headers/footers.
PDF endpoints return `Content-Type: application/pdf`. The barcode endpoint returns SVG or PNG images.
GET /api/v1/pdf/barcode Direct Barcode / QR Code generator
Generates standalone vector SVG or PNG barcode and QR code images directly without creating a PDF.
Parameters
NameInTypeDescription
data* query string Text or numeric data to encode.
type query string Barcode standard.
format query string Output image format.
width query integer Desired pixel width.
height query integer Desired pixel height.
fg query string Foreground color name or hex code (e.g. "black", "#0d6efd").
bg query string Background color name or hex code (e.g. "white", "#f8f9fa").
text query boolean Whether to show human-readable text below 1D barcodes.
Responses
200 Generated barcode image (SVG or PNG).
400 Missing data parameter or invalid barcode standard.
500 Barcode generation error.
POST /api/v1/pdf/generate HTML + CSS → PDF
Renders an HTML document or fragment to PDF using headless Chromium.
Supports embedded `<qr-code>` and `<bar-code>` custom tags, custom CSS, and running headers and footers.
Request Body
application/json
FieldTypeDescription
html* string HTML content to render. Can include custom tags `<qr-code>` and `<bar-code>`.
locale string BCP 47 locale for date/number formatting, e.g. "de-DE", "en-US". Default "en-US".
timezone string IANA timezone string for dates, e.g. "Europe/Berlin", "UTC".
header object Page header configuration (title, subtitle, author, date, logo_base64, etc.).
footer object Page footer configuration (username, custom_text, show_page_numbers, show_date, etc.).
options object Chromium PDF printing options (format, landscape, scale, print_background, margins).
Responses
200 PDF binary data.
400 Missing or invalid request body.
500 Chromium PDF generation failed.
POST /api/v1/pdf/table/csv CSV data → table PDF
Parses raw CSV data and renders a styled, paginated table report as a PDF.
Request Body
application/json
FieldTypeDescription
csv* string Raw CSV text content (first row treated as header).
delimiter string CSV delimiter character (default `,`).
title string Report title shown at the top of the PDF.
header_map object Mapping of CSV column header names to display labels.
columns array Optional explicit column definitions for formatting.
locale string BCP 47 locale for number and date formatting, e.g. "de-DE".
timezone string IANA timezone string for dates, e.g. "Europe/Berlin".
table_style object Visual style options (striped, bordered, compact).
landscape boolean Render in landscape orientation. Default false.
Responses
200 PDF binary data.
400 Invalid CSV or missing fields.
500 Rendering error.
POST /api/v1/pdf/table/data Structured JSON data → table PDF
Renders a styled, paginated table report from JSON column definitions and rows.
Columns can be formatted as barcodes, QR codes, currency, dates, numbers, or percentages.
Request Body
application/json
FieldTypeDescription
columns* array Array of column definitions (key, label, align, width, format e.g. currency, qrcode, barcode-code128, barcode-ean13, barcode-datamatrix).
rows* array Array of row objects keyed by column names.
footer_rows array Optional summary or totals rows placed in table footer.
locale string BCP 47 locale for number and currency formatting, e.g. "de-DE".
timezone string IANA timezone string for dates, e.g. "Europe/Berlin".
header object Header configuration (title, subtitle, author, show_date).
footer object Footer configuration (username, show_page_numbers).
table_style object Visual style options (striped, bordered, compact, header_color, header_text_color).
page_format string Page format, e.g. "A4", "Letter".
landscape boolean Render in landscape orientation. Default false.
Responses
200 PDF binary data.
400 Invalid JSON structure or missing columns/rows.
500 Rendering error.
POST /api/v1/pdf/table/html HTML table fragment → table PDF
Accepts an HTML `<table>` fragment and wraps it in a styled PDF layout with pagination and running headers/footers.
Request Body
application/json
FieldTypeDescription
table_html* string Raw HTML table fragment (e.g. `<table>...</table>`).
locale string BCP 47 locale for pagination labels.
header object Header configuration.
footer object Footer configuration.
page_format string Page format, e.g. "A4".
landscape boolean Render in landscape orientation. Default false.
Responses
200 PDF binary data.
400 Missing table HTML content.
500 Rendering error.
GET /health Health check
Returns service status, uptime, and Chromium browser pool statistics.
Responses
200 Service is healthy.
503 Service is degraded (pool exhausted or Chromium error).