What’s new
This release turns resource use that depended on input size into documented, deterministic limits. Each limit is checked before gPdf lays out, decodes, meshes, or rasterizes the input it bounds, and a violation returns an error that names the limit instead of exhausting memory or CPU.
Tables and barcodes
Table spans may not extend past the last row or column. One table holds at
most 65536 grid cells, counted as body rows plus shown header rows times
columns, and all tables in one request or Template batch hold at most 262144.
Barcode content holds at most 4096 UTF-8 bytes, format and shape names at most
64 bytes, bearer bars that are drawn at most 64 modules, and the encoded symbol
at most 1048576 modules (65536 with circle modules, except MaxiCode). These
violations return API-002.
Raster and SVG images
PNG and WebP images are checked from their headers before decoding: at most
8192 pixels per side, 4194304 pixels, and 16777216 decoded bytes, with every
WebP frame counted. Larger images, and WebP files whose chunks extend past the
image data, return API-007. JPEG images are embedded
without decoding and have no pixel limit.
SVG images load only embedded data: images, which follow the same limits;
other references are ignored. Compressed SVG (svgz) is rejected. Filters are
rasterized at a lower resolution when their estimated cost would exceed the
budget, and return API-002 beyond 1048576 pixels per region, 64 primitives,
numOctaves 8, or 1024 convolution kernel taps. The same limits apply to
nested SVG images, patterns, masks, and clip paths rendered inside a filtered
group, and the filtered groups of one SVG share its work budget. Work that does
not shrink with the resolution, such as a raster image rendered many times
inside a filtered group, returns API-002 when it exceeds that budget at every
resolution.
Colour values
Every colour in a request is written as #RRGGBB: # followed by six
hexadecimal digits, in either case. Other forms, such as 2563EB without #,
#fff, #2563EB80, red, or rgb(), return API-002 with an error that
names the field. Shape, container, table, barcode, watermark, and
settings.defaults colours used to be drawn black when they could not be
parsed; they are now rejected like every other colour field. Use the matching
opacity field for transparency.
Barcodes
Barcodes are encoded with xBarcode 2.0.0. Every documented format value and
alias is unchanged. Some symbols use fewer codewords for the same content and
never a larger symbol: QR tracking numbers and GS1 element strings may get a
different module pattern or a smaller version, and Data Matrix, PDF417,
MicroPDF417, Aztec, and Code 128 text may encode more compactly. Full-range
Aztec symbols now draw the centre row and column of the reference grid, and
Micro QR encodes Latin-1 characters as ISO-8859-1. The encoded text of every
symbol is unchanged.
Barcode content must contain a non-whitespace character on every element, as
in table cells, and content over a format’s own capacity returns API-002
instead of API-501. Non-GS1 Code 128 encodes ~1 and {FNC1} sequences as
literal text. The API reference changelog
lists every change.
Capability errors and discovery
When a request needs data.projection or layout.flow_document and the target
build does not compile or enable it, the error body now names the capability in
an optional capability field. The code, message, and HTTP status are
unchanged, and every other error body keeps exactly error, code, message,
and req_id. POST /health also reports catalog_version, the version of
the capability id vocabulary, beside enabled_capabilities; Native servers
send it as the X-GPDF-Catalog-Version header, and the Wasmer package does
from its next release. Read the advertised ids as a set. See
capability discovery.
Compatibility
Well-formed requests within these limits render as before, except that costly
SVG filters, such as large feMorphology radii, may now use a lower raster
resolution, and some barcode symbols, such as QR tracking numbers, may use a
different module pattern that decodes to the same text.
Requests beyond the limits now fail with API-002 or API-007; split large
tables, shorten barcode content, downscale images, or simplify SVG artwork.
Requests with a colour that is not #RRGGBB now fail with API-002; write the
colour as # and six hex digits. The capability error field and the health
catalog_version are additive; clients that ignore unknown fields are
unaffected. Barcodes with empty content, or content over
the capacity of their format, now fail with API-002.
The exact values are listed in the API reference limits.