Thomas Leitner's Avatar

Thomas Leitner

@gettalong

(Open source) Software developer, creator of kramdown and HexaPDF, Sci-Fi fan.

30
Followers
55
Following
28
Posts
17.11.2024
Joined
Posts Following

Latest posts by Thomas Leitner @gettalong

Post image

Time for another Vienna Ruby Meetup! ๐ŸŽ‰

It's been three months since the last meetup. To make up for it, we got three wonderful talks covering a wide range of topics this time.

Thank you to Meister for hosting us!

09.02.2026 19:13 ๐Ÿ‘ 1 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Changelog - HexaPDF

Released #HexaPDF 1.4.1 with some fixes - see hexapdf.gettalong.org/documentatio...

23.09.2025 21:33 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

You can't generally use an embedded font to add new content (because it usually misses parts in the font data structure; even if usable it might be missing characters).
Viewers work around this by loading the same font from the system paths.
With HexaPDF you need to specify the font yourself.

23.09.2025 15:49 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
hexapdf/lib/hexapdf/cli/merge.rb at master ยท gettalong/hexapdf Versatile PDF creation and manipulation for Ruby. Contribute to gettalong/hexapdf development by creating an account on GitHub.

Yes!

But did you know that you can even parse arbitrary strings? ๐Ÿ˜†

Example: github.com/gettalong/he... (used for interleaving and handling file names and options).

11.06.2025 20:29 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
how to send keyboard strokes programmatically (like "sendkeys" in Windows) to a Wayland Linux window (KDE/GNOME)? I'm writing a desktop automation software, which drives a GUI desktop, on linux. It works pretty well, but Wayland is blocking inter-window communication, especially when entering non-ASCII charact...

Maybe bind ALT-C to a command that sends CTRL-C? Or do something like this: unix.stackexchange.com/questions/78...

10.06.2025 14:38 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

* KDE lets you configure which short-cut switches between applications (ALT-Tab) and which between their windows (Alt-`).
* The built-in KDE krunner application is sufficient as launcher for my needs.
* Clipboard history just works in KDE.
* Vim GUI -> gvim

10.06.2025 14:33 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

If you are using KDE, you should be able to just configure this system-wide for all KDE based apps.

10.06.2025 14:29 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
BreakVer | Taoensso

Or just use BreakVer www.taoensso.com/break-versio... and break things like before ๐Ÿ˜

09.06.2025 23:08 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

So, I now have implemented a basic template system for VersaDok.

However, using ERB as preprocessor instead of the built-in template system is faster in most cases (even though the larger source doc needs to be parsed every time) because AST nodes need to be rendered many times more.

09.06.2025 12:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Thanks for the great meetup! And thanks to @hansschnedlitz.com for organizing it and doing the cool Ruby quiz!

07.06.2025 09:45 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
GitHub - gettalong/versadok: Versatile document creation markup and library Versatile document creation markup and library. Contribute to gettalong/versadok development by creating an account on GitHub.

And now the code is available at github.com/gettalong/ve...

It is not yet finished and not really polished etc. but already in a good state.

This will be the basis for still more easily creating PDF documents with HexaPDF ๐Ÿ˜€

02.06.2025 21:38 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Changelog - HexaPDF

Worked now! And just released the new version - see hexapdf.gettalong.org/documentatio...

24.04.2025 05:35 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
RubyGems.org | your community gem host

Once rubygems.org sends me the password reset e-mail that I already requested a few times, I can release a new version of #HexaPDF

23.04.2025 21:32 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Array#[]=(e.g. ary[-10, 10] = EMPTY_ARRAY) won't create an additional array but is slower then Array#pop, so I'm staying with the latter.

17.03.2025 22:26 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Parsing into AST a file with kramdown vs versadok Parsing into AST a file with kramdown vs versadok. GitHub Gist: instantly share code, notes, and snippets.

Full benchmark info here gist.github.com/gettalong/b8...

12.03.2025 22:34 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Without YJIT on Ruby 3.4.1

Warming up --------------------------------------
            kramdown    259.422 i/s -     270.000 times in 1.040775s (3.85ms/i)
            versadok     1.158k i/s -      1.265k times in 1.091970s (863.22ฮผs/i)
Calculating -------------------------------------
            kramdown    276.681 i/s -     778.000 times in 2.811901s (3.61ms/i)
            versadok     1.138k i/s -      3.475k times in 3.052762s (878.49ฮผs/i)

Comparison:
            versadok:      1138.3 i/s
            kramdown:       276.7 i/s - 4.11x  slower

With YJIT on Ruby 3.4.1

Warming up --------------------------------------
            kramdown    334.871 i/s -     336.000 times in 1.003372s (2.99ms/i)
            versadok     1.853k i/s -      1.969k times in 1.062396s (539.56ฮผs/i)
Calculating -------------------------------------
            kramdown    315.374 i/s -      1.004k times in 3.183520s (3.17ms/i)
            versadok     1.822k i/s -      5.560k times in 3.052272s (548.97ฮผs/i)

Comparison:
            versadok:      1821.6 i/s
            kramdown:       315.4 i/s - 5.78x  slower

Without YJIT on Ruby 3.4.1 Warming up -------------------------------------- kramdown 259.422 i/s - 270.000 times in 1.040775s (3.85ms/i) versadok 1.158k i/s - 1.265k times in 1.091970s (863.22ฮผs/i) Calculating ------------------------------------- kramdown 276.681 i/s - 778.000 times in 2.811901s (3.61ms/i) versadok 1.138k i/s - 3.475k times in 3.052762s (878.49ฮผs/i) Comparison: versadok: 1138.3 i/s kramdown: 276.7 i/s - 4.11x slower With YJIT on Ruby 3.4.1 Warming up -------------------------------------- kramdown 334.871 i/s - 336.000 times in 1.003372s (2.99ms/i) versadok 1.853k i/s - 1.969k times in 1.062396s (539.56ฮผs/i) Calculating ------------------------------------- kramdown 315.374 i/s - 1.004k times in 3.183520s (3.17ms/i) versadok 1.822k i/s - 5.560k times in 3.052272s (548.97ฮผs/i) Comparison: versadok: 1821.6 i/s kramdown: 315.4 i/s - 5.78x slower

So I have been working on something lately, lightweight markup related.

Turns out it's at least 4 times faster than kramdown when parsing the same document (n.b. a bit of an apple to banana comparison as kramdown can do much more at the moment but still ๐Ÿคฏ)

12.03.2025 22:31 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0
The benchmark YAML file for benchmark-driver

The benchmark YAML file for benchmark-driver

Warming up --------------------------------------
                 pop     5.802M i/s -      6.040M times in 1.041085s (172.36ns/i, 187clocks/i)
              slice!     4.235M i/s -      4.459M times in 1.052689s (236.11ns/i, 625clocks/i)
                 []=     5.158M i/s -      5.168M times in 1.001836s (193.86ns/i, 211clocks/i)
Calculating -------------------------------------
                 pop     5.946M i/s -     17.406M times in 2.927538s (168.19ns/i, 426clocks/i)
              slice!     4.100M i/s -     12.706M times in 3.098945s (243.90ns/i, 738clocks/i)
                 []=     5.415M i/s -     15.475M times in 2.857926s (184.68ns/i, 808clocks/i)

Comparison:
                 pop:   5945557.8 i/s
                 []=:   5414702.4 i/s - 1.10x  slower
              slice!:   4100124.2 i/s - 1.45x  slower

Warming up -------------------------------------- pop 5.802M i/s - 6.040M times in 1.041085s (172.36ns/i, 187clocks/i) slice! 4.235M i/s - 4.459M times in 1.052689s (236.11ns/i, 625clocks/i) []= 5.158M i/s - 5.168M times in 1.001836s (193.86ns/i, 211clocks/i) Calculating ------------------------------------- pop 5.946M i/s - 17.406M times in 2.927538s (168.19ns/i, 426clocks/i) slice! 4.100M i/s - 12.706M times in 3.098945s (243.90ns/i, 738clocks/i) []= 5.415M i/s - 15.475M times in 2.857926s (184.68ns/i, 808clocks/i) Comparison: pop: 5945557.8 i/s []=: 5414702.4 i/s - 1.10x slower slice!: 4100124.2 i/s - 1.45x slower

Ah, I forgot up that - thank you! You can further optimize it by using a constant empty array and doing `array[from, size] = EMPTY_ARRAY`.

I did a benchmark comparing pop, slice! and your method using benchmark-driver. Interestingly pop was faster even though it creates arrays.

11.03.2025 22:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

So, Ruby friends, how do I remove count number of trailing elements from an array *without* creating a new result array?

There is Array#pop(count) but that creates an array I don't need or want ;-)

11.03.2025 10:10 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

@itext.bsky.social Congrats on the release of 9.1! ๐ŸŽ‰

The table rendering speed-up is great! Is the source code for the benchmark available somewhere?

18.02.2025 22:17 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Image of 10 line annotations with different styles

Image of 10 line annotations with different styles

Coming with the next release to #HexaPDF: Line annotation appearance generation. Other annotation types will follow.

09.02.2025 08:43 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
EuroPDF - create PDFs from HTML, fast and secure!BASH_logo-transparent-bg-bw

Can also recommend weasyprint if you need HTML/CSS -> PDF.

If you want more quality and better conversion, a commercial solution based on PrincePDF is available via www.europdf.eu

And a heads up from me: There will be a markup-to-PDF pipeline for HexaPDF in the near future :-)

07.01.2025 15:39 ๐Ÿ‘ 5 ๐Ÿ” 2 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

It seems that Ruby getting faster with each release is now the norm. As no one is pointing it out anymore ๐Ÿ˜€

02.01.2025 09:44 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
HexaPDF Extras: HexaPDF::Extras::Layout::SwissQRBill Additional functionality for the HexaPDF library

New release of hexapdf-extras to make it compatible with HexaPDF 1.0.

The API docs now also have a visual example of a Swiss QR bill - hexapdf-extras.gettalong.org/api/HexaPDF/...

01.01.2025 07:38 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I use unary + for normal UTF-8 encoded strings and "literal".b for binary ones.

14.12.2024 14:52 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

๐ŸŽ„ T-24 hours until #AdventOfCode 2024! ๐ŸŽ„

30.11.2024 05:23 ๐Ÿ‘ 256 ๐Ÿ” 46 ๐Ÿ’ฌ 8 ๐Ÿ“Œ 9

Yes, I also think so. When I wanted to formulate the versioning scheme for HexaPDF, I came across BreakVer ๐Ÿ™‚

22.11.2024 14:18 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Understood ๐Ÿ˜†

I also kept HexaPDF on 0.x versions for a long time (8 years) but decided to change it to 1.0 this October, now following BreakVer instead of SemVer.

22.11.2024 07:13 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
BreakVer | Taoensso

What do you do in case of breaking changes? Just a highlighted entry in the changelog?

I have found that BreakVer (www.taoensso.com/break-versio...) is the versioning scheme I'm most comfortable with.

21.11.2024 10:43 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
News | kramdown kramdown is a fast, pure-Ruby Markdown-superset converter

New version of kramdown released!

kramdown.gettalong.org/news.html

18.11.2024 09:15 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Initial post.

17.11.2024 20:44 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0