* Alexander Schöpe <[email protected]>
| ANNOUNCE: tclpdf 1.0 released
| =============================
| tclpdf is a pure Tcl extension for creating PDF documents: pages and
| graphics, embedded TrueType fonts subset to the glyphs actually used,
| JPEG and PNG images, tables, and electronic invoices as ZUGFeRD /
| Factur-X in PDF/A-3B. Developed by Alexander Schoepe, it requires only
| Tcl 8.6.11+ and runs under Tcl 9 as well; zlib is a built-in command
| rather than a package, and Tk is not used.
Simply awesome!
| Highlights:
--<snip-snip>--
| * Images: JPEG and PNG go in unchanged wherever possible - a JPEG as
| /DCTDecode, a PNG without alpha as /FlateDecode with /Predictor 15,
| neither ever decoded.
How much work would it be to support EPS (Encapsulated PostScript) as
well? Sounds silly, I know, 'but'... :-)
R'
* Alexander Schöpe <[email protected]>--- Synchronet 3.22a-Linux NewsLink 1.2
| ANNOUNCE: tclpdf 1.0 released
| =============================
Simply awesome!
* Alexander Schöpe <[email protected]>
| Am 11.08.26 um 14:25 schrieb Ralf Fassel:
| > * Alexander Schöpe <[email protected]>
| > | ANNOUNCE: tclpdf 1.0 released
| > | =============================
| > --<snip-snip>--
| > | * Images: JPEG and PNG go in unchanged wherever possible - a JPEG as
| > | /DCTDecode, a PNG without alpha as /FlateDecode with /Predictor 15,
| > | neither ever decoded.
| > How much work would it be to support EPS (Encapsulated PostScript)
| > as well?
--<snip-snip>--
| EPS is indeed an interesting special case. I have looked into it in
| more detail now. The short answer is: embedding EPS is not really the
| difficult part — understanding its contents is.
...in my special case it would add a bitmapped picture inside the EPS
encoded as a giant hex string :-)
| A natural idea would be to simply embed the PostScript in the PDF.
| PDF 1.7 did in fact allow this through an XObject with /Subtype /PS.
That's what I had hoped for...
| However, ISO 32000-1 already says in §8.8.1 that “PostScript
| XObjects should not be used”. §8.8.2 explains why: such fragments
| “shall have no effect either when viewing the document on-screen or
| when printing it to a non-PostScript device”. And in ISO 32000-2 (PDF
| 2.0), PostScript XObjects do not occur at all; they are no longer part
| of the specification.
:-/
| Converting EPS to PDF or SVG, on the other hand, works perfectly
| well. That is probably the approach I would recommend: convert the EPS
| beforehand with a suitable tool and give tclpdf the result.
d'accord.
| I don’t want to make a PostScript interpreter a dependency of tclpdf.
I agree, that's too complicated.
Thanks for all your contributions to TCL!
R'
ANNOUNCE: tclpdf 1.0 released
=============================
tclpdf is a pure Tcl extension for creating PDF documents: pages and graphics, embedded TrueType fonts subset to the glyphs actually used,
JPEG and PNG images, tables, and electronic invoices as ZUGFeRD /
Factur-X in PDF/A-3B. Developed by Alexander Schoepe, it requires only
Tcl 8.6.11+ and runs under Tcl 9 as well; zlib is a built-in command
rather than a package, and Tk is not used.
1.0 is the first release.
On 8/10/2026 10:24 AM, Alexander Schöpe wrote:
ANNOUNCE: tclpdf 1.0 released
=============================
tclpdf is a pure Tcl extension for creating PDF documents: pages and
graphics, embedded TrueType fonts subset to the glyphs actually used,
JPEG and PNG images, tables, and electronic invoices as ZUGFeRD /
Factur-X in PDF/A-3B. Developed by Alexander Schoepe, it requires only
Tcl 8.6.11+ and runs under Tcl 9 as well; zlib is a built-in command
rather than a package, and Tk is not used.
1.0 is the first release.
Awesome!
A frequent need is to sometimes create a new PDF out of many different documents. So you add take a screenshot, one or two text documents, some images, etc. and put them all in one single pdf (not as attachments) so
your boss can read all without boethring with unzipping, opening and
closing multiple documents, and getting lost in the order they need to
look at it.
Does it currently have a command to do this?
* Alexander Schöpe<[email protected]>
| ANNOUNCE: tclpdf 1.0 released
| =============================
| tclpdf is a pure Tcl extension for creating PDF documents: pages and
| graphics, embedded TrueType fonts subset to the glyphs actually used,
| JPEG and PNG images, tables, and electronic invoices as ZUGFeRD /
| Factur-X in PDF/A-3B. Developed by Alexander Schoepe, it requires only
| Tcl 8.6.11+ and runs under Tcl 9 as well; zlib is a built-in command
| rather than a package, and Tk is not used.
| 1.0 is the first release.
| Download / Repository:https://fossil.sowaswie.de/tclpdf
Though it seems obvious for the experienced user, a (short) section in
the documentation about how to install the downloaded tclpdf1.0.tar.gz
would be nice.
Also is there a specific reason why many of the tarfile contents are
mode 600 (should be 644 IMHO)? This leads to all kind of trouble when unpacking the distribution at the final destination.
drwxrwxr-x alex/staff 0 tclpdf1.0/
-rw------- alex/staff 18437 tclpdf1.0/table.tcl
-rw-r--r-- alex/staff 12844 tclpdf1.0/otLayout.tcl
-rw------- alex/staff 16722 tclpdf1.0/svg.tcl
-rw------- alex/staff 12190 tclpdf1.0/shading.tcl
-rw------- alex/staff 26237 tclpdf1.0/text.tcl
-rw------- alex/staff 9883 tclpdf1.0/subset.tcl
-rw------- alex/staff 11846 tclpdf1.0/image.tcl
-rw------- alex/staff 6120 tclpdf1.0/imageJpeg.tcl
-rw-r--r-- alex/staff 8069 tclpdf1.0/kernGpos.tcl
-rw------- alex/staff 7566 tclpdf1.0/tableDraw.tcl
-rw-r--r-- alex/staff 12079 tclpdf1.0/page.tcl
[...]
R'
ANNOUNCE: tclpdf 1.0 released[snip]
On Mon, 10 Aug 2026 16:24:24 +0200, Alexander Schöpe wrote:
ANNOUNCE: tclpdf 1.0 released[snip]
I tried this out and found it easy to install and easy to use.
However, I've had a problem printing a Unicode character.
Early in my code I have:
set pdf [tclpdf new -format a4 -unit mm -orientation portrait]
try {
$pdf page add
$pdf font embed freesans [file home]/.fonts/FreeSans.ttf
then later on I try to output a ✔ symbol:
$pdf font -family freesans -size 22 -color black
$pdf text ✔ -at [list [expr {2.5 + $x}] [expr {8.5 + $y}]]
But it gives me an error:
tclpdf: the font "freesans" has no glyph for U+2714 (position 0) - it cannot be written with this face
while executing
"my FontEncode $font $string"
(class "::tclpdf::document::document" method "TextEncode" line 3)
invoked from within
"my TextEncode $font $string"
(class "::tclpdf::document::document" method "TextRun" line 33)
invoked from within
"my TextRun $string $state $x $y [dict get $options rotate]"
(class "::tclpdf::document::document" method "text" line 53)
invoked from within
"$pdf text ✔ -at [list [expr {2.5 + $x}] [expr {8.5 + $y}]]"
However, I know that this glyph is in FreeSans.ttf because I have a little program, fontviewer.tk, which shows it to me; here's a line of its output that uses the FreeSans font:
FreeSans: QO01liI ✘ ✔ 🗹 • … The quick brown fox jumped over the lazy dogs
I don't know if it is relevant but all the other text in the PDF is written using the built-in Helvetica font.
Thank you for trying tclpdf, and for the clear report.[snip]
The cause is the font file itself: FreeSans.ttf does not contain U+2714 (heavy check mark). I checked the last GNU FreeFont release, 2012-05-03,
and it is not in FreeSans - nor are U+2718 (heavy ballot X) or the
ballot boxes U+2610 and U+2611. FreeSerif from the same package has all
of them, and so do DejaVu Sans and Noto Sans Symbols 2, for example.
Your viewer probably shows the character anyway because Tk, as most
screen rendering does, substitutes a glyph from another installed font
when the requested one lacks it. tclpdf cannot do that: the PDF names
the embedded font program the glyph comes from, so a character the font
does not have would appear as an empty box in the reader. That is why it stops at the call and names the character instead.
Have you tried DejaVu Sans (or Noto Sans Symbols 2) for the symbol? A
second embed and a switch of face just for that call is all it takes, e.g.
$pdf font embed symbols /path/to/DejaVuSans.ttf
...
$pdf font -family symbols -size 22 -color black
$pdf text ✔ -at [list [expr {2.5 + $x}] [expr {8.5 + $y}]]
The face is chosen per call, so the rest of your text stays in FreeSans
(or Helvetica) as it is; FreeSerif from your FreeFont package works the
same way. If it helps, [$pdf textWidth "✔" -family freesans] gives the same error without drawing anything, so you can check a face at start-up.
I will add a note about this to the manual - the "but my viewer shows
it" case will come up again. Thanks again for the feedback.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,142 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 92:10:19 |
| Calls: | 14,704 |
| Calls today: | 2 |
| Files: | 186,497 |
| D/L today: |
2,083 files (617M bytes) |
| Messages: | 2,551,639 |