#PDFTris

2025-06-08

:tetris:📄 You can now play Tetris in a PDF File.

[Thomas Rinsma], a security analyst and hobbyist tinkerer, recently figured out how to create a version of Tetris that runs inside a PDF file. He tackled the project “just for fun” after learning the potential implementations of PDF’s JavaScript API. The result is a novel version [Rinsma] calls PDFTRIS.

github.com/ThomasRinsma/pdftri

#pdf #tetris #pdftris #gaming #engineer #artist #media #javascript #programming #art #tech #news

There’s a global community dedicated to finding new ways to challenge themselves in Tetris, from speedruning the classic puzzler to technically “beating” it. But the latest feat isn’t a newly discovered hidden glitch or high score — it’s an entirely new way to play the game.[ImageSource: Thomas Rinsma]

[Rinsma] explained that it’s already “relatively well-known” that PDFs can support a number of features such as dynamic content scripting when opened in something like Adobe Acrobat/Reader. Some of that same scripting support, however, is also available in both Mozilla Firefox and Google Chromium’s respective PDF readers, PDF.js and PDFium.

The PDF containing a 10×20 grid of field buttons. These alternate between shaded and empty blocks depending on the JavaScript input, allowing a player to use preprogrammed keyboard instructions to move and shift the tetronimoes — the official term for four-block shapes such as those in Tetris blocks.

“It was a bit tricky to find a union of features that work in both engines, but in the end it turns out that showing/hiding annotation ‘fields’ works well to make monochrome pixels, and keyboard input can be achieved by typing in a text input box,” [Rinsma] wrote in a post.

<https://th0mas.nl/2025/01/12/tetris-in-a-pdf/>

Thomas Rinsma decided to abuse PDF field objects to render monochrome grid, and combine it with keystroke-entry in a text field to receive inputs – that’s how #PDFTris, a playable Tetris in a PDF file was born.

gamedevjs.com/games/pdftris-pl

#gamedev #gamedevjs #pdf #tetris #pdfjs

PDFTris

PDF瀏覽器內玩遊戲 PDFTris突破創意界限
網頁瀏覽器內置的 PDF 檢視器,如 Chrome 和 Firefox,現已成為一款極具創意的遊戲平台。由 T […]
The post PDF瀏覽器內玩遊戲 PDFTris突破創意界限 appeared first on 香港 unwire.hk 玩生活.樂科技.
#遊戲情報 #PDFTris
unwire.hk/2025/01/11/pdftris/g

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst