🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.tcl
Article #150

ANNOUNCE: tclpdf 1.8 released - what three field reports asked for

#150
From: Alexander Schöpe
Date: Wed, 25 Nov 2026 16:06
122 lines
8194 bytes
ANNOUNCE: tclpdf 1.8 released - what three field reports asked for
==================================================================

tclpdf is a pure Tcl extension for creating PDF: graphics, embedded and 
colour fonts, JPEG, PNG, TIFF and SVG, rich text in paragraphs and 
tables (run list, tags or Markdown), layers, form fields, tagged 
documents up to PDF/UA-2, encryption, signatures, timestamps and ZUGFeRD 
/ Factur-X invoices in PDF/A-3B. It can import pages of existing PDFs 
and update files incrementally. By Alexander Schoepe, for Tcl 8.6.11+ 
and Tcl 9; tdom, http and tls are optional (XMP metadata, timestamps), 
Tk is not used.

Built against ISO 32000-1/-2, PDF/A, PDF/UA, EN 16931 with ZUGFeRD / 
Factur-X, ETSI EN 319 142-1, RFC 5652 and RFC 3161. veraPDF, 
Mustangproject, qpdf and pdfsig check every document on every run; 4992 
tests pass under Tcl 8.6.18 and 9.0.4.

1.8 is the release that three production users asked for. Each had sent 
a report on what they had to work around in 1.7: a glyph the face lacks 
that failed the whole document, page numbers that could not count a 
section on its own, an invoice that had to be written to a temporary 
file before it could be attached, an SVG logo from Illustrator that came 
out black, Markdown typed by users that was refused as a whole. Every 
point was measured against the tree first; what turned out to be already 
there got its sentence in the manual, what was missing got built, each 
with a test that a single reverted line turns red. 1.7.3, released the 
same month, closed the leading-zero defect underneath all of it, and its 
tech note says why it took so long to see.

What tclpdf 1.8 does, and what it deliberately does not: 
https://fossil.sowaswie.de/tclpdf/technote/a518ade963
Why 1.7.3 - a leading zero, two interpreters, two files: 
https://fossil.sowaswie.de/tclpdf/technote/85872757e9

Wiki (manual, tables, markup, accessibility, test tools): 
https://fossil.sowaswie.de/tclpdf/wcontent
Examples, every script with its finished PDF: 
https://fossil.sowaswie.de/tclpdf/wiki?name=examples
Download / Repository: https://fossil.sowaswie.de/tclpdf

Author: Alexander Schoepe <alx.tcl@sowaswie.de>


New in 1.8:

* A missing glyph can be replaced on request: textMissing names the 
characters neither the family nor its fallback chain can set; font 
-missing replace draws -replacement (U+FFFD by default) in their place 
with the original kept as ActualText, so a screen reader and a copy 
still get the text; textReplaced counts what was drawn and the event 
glyphReplaced fires per character. The default stays the refusal, and 
nothing is ever replaced in silence. A field's appearance stream never 
takes the chain or the replacement.
* Page numbers for a section: pageNumbers -to names the last page 
numbered and -start the number the first one carries, so an appendix 
behind a delivery note counts "page 1 of 4" on its own while the copy 
sheet behind it carries none; -anchor places the number as text does.
* zugferd takes the invoice from -data bytes with a -date, mirroring 
attach -data; a path together with -data, in zugferd and in attach, is 
refused instead of one of them being dropped.
* CSS class rules from an SVG style block are read: .name selectors and 
comma groups, for fill, stroke, opacity, stop colours, clip-path, mask 
and everything else an attribute or style="" sets, cascaded attribute, 
class, style. An Illustrator export and the official ZUGFeRD logo come 
out in their colours. At-rules and other selectors stay unread and 
reported by svg info, which now counts a style block under defs as well.
* Markdown and tags typed by users: markdown::repair and markup::repair 
return the text with every refused place escaped as a literal, and the 
list of faults removed, so the caller sets the strict way and logs what 
was not formatted. No lenient mode; a price never disappears in silence.
* Headings get their own spacing with -headingSpacing before and after, 
added to -paragraphSpacing and never at the start or the end of the block.
* ModDate is stamped into the Info dictionary beside CreationDate, from 
the same moment as xmp:ModifyDate; beside a caller's own XMP packet 
neither is stamped, so PDF/A-1b finds no mismatch.
* A -leading below half the size is refused once a paragraph has two 
lines, with the leading in points it probably meant - the value 1.3 as a 
factor stacked every line on the one before.
* An option refusal quotes a long word in short, so an invoice handed 
over as -data no longer lands in the error message whole.
* make install refreshes pkgIndex.tcl before it copies, so a version 
bump installs the new index, and sets the mode of every installed file - 
a tree checked out as 0600 no longer installs unreadable for the web server.
* The manual says what the reports had missed: the return of text is the 
next baseline, -leading is in points and the table key a factor, 
-fallback rescues the no-break spaces and hyphen variants a pasted text 
brings, justify without -hyphenate leaves gaps, a heading in a table 
cell is one -didParseCell hook away, where the Debian hyphenation 
patterns live, where the Claude skill lives.
* Every module that changed since 1.7.3 carries a new version, held 
against the release tags by the test suite; two new modules, svgCss and 
textMissing.

Fixes since 1.7.2, released as 1.7.3:

* Numbers with a leading zero are read in decimal under Tcl 8.6 and Tcl 
9 alike, in options, in foreign PDFs, in SVG, font and hyphenation 
files; a text of digits - a field name, an export value, a link address, 
a keyword - stays text. Both interpreters write the same file.
* SVG stop-color in rgb() notation no longer loses the drawing; 
coordinates with an exponent are written as PDF numbers; both XML 
parsers refuse the same files under the same codes; the XMP packet set 
with metadata is checked against entity expansion; the first structure 
... -script of a process runs in the caller's frame.

Notes:

* Installing: the release archives tclpdf1.8.zip and tclpdf1.8.tar.gz 
hold one directory tclpdf1.8 with the modules, pkgIndex.tcl and the ICC 
profiles - nothing to build; extract it into a directory on your 
auto_path and "package require tclpdf" finds it. The source archive 
builds the TEA way in the source directory: ./configure, make test, make 
install.
* No font is part of the package. The faces under examples/assets/fonts 
travel in the source archive alone; "make install" installs none. What 
is installed besides the MIT-licensed modules carries its own terms in 
the files: the ICC profiles, the Adobe-derived widths, the Unicode tables.
* Not coming, each for a measured reason: a heading inside a table cell 
as its own size, nested lists, runs that change the size or the colour, 
PDF/X, RC4 and the older encryption revisions, EPS, GIF and BMP, a CII 
invoice generator, silent replacement of a missing glyph, a lenient 
Markdown mode.
Technical Details
Message-ID: <11e711u$3t23e$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Alexander Schöpe <ete-sep@mxbo.de>
Newsgroups: comp.lang.tcl
Subject: ANNOUNCE: tclpdf 1.8 released - what three field reports asked for
Date: Wed, 25 Nov 2026 17:06:22 +0100
Organization: A noiseless patient Spider
Lines: 122
Message-ID: <11e711u$3t23e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Nov 2026 16:06:23 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="4098158"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/zr01+TSzfLy8btSxRiSDtfY9SH8KQt1Q="; posting-host="b8e3b9c4bc4d9016bb616c5ffae5af95"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1yhIsVxywylkjfEYwEmddwdPoWg= sha256:bO2ahkQsF4rY1Edbki/MG0gMKJo02HePYDTdSwIERkU=
	sha1:pwQmw8tyQTSTK/tpck5CU5u33v4= sha256:GRARv+l0eZAJioVxdZNt+/S4n+Y3wkxyC2VMN5ps+xE=