PDF Tetris is a groundbreaking implementation of the classic Tetris game that runs entirely within a PDF document. Created by Thomas Rinsma, this innovative project demonstrates the unexpected capabilities of PDF's JavaScript engine. Using browser PDF engines (PDFium and PDF.js), the game renders graphics through annotation fields and captures keyboard input through text boxes, creating a fully playable Tetris experience in an unconventional format.
Playing PDF Tetris is straightforward - simply open the PDF in your modern desktop browser. Use the arrow keys to move and rotate the falling blocks. Left and right arrows move the pieces horizontally, while the up arrow rotates them. The down arrow accelerates the piece's descent. Complete lines by filling them with blocks to clear them and score points. The game continues until the blocks reach the top of the playing field. The innovative part? All of this happens within a PDF document!
PDF Tetris utilizes the JavaScript capabilities built into modern PDF engines (PDFium and PDF.js). It uses PDF annotation fields for graphics and text input boxes for keyboard controls, creating a playable game entirely within a PDF document.
PDF Tetris works best in modern desktop browsers with updated PDF engines. This includes recent versions of Chrome, Firefox, and other browsers that use PDFium or PDF.js.
Yes, PDF Tetris is open source. The source code is available on GitHub, allowing anyone to study how it works or create their own PDF-based games.
PDF Tetris was created as an experimental project to demonstrate the unexpected capabilities of PDF scripting and show that PDFs can do more than just display static documents.
No special software is required beyond a modern web browser. The game runs directly in your browser's built-in PDF viewer.
PDF Tetris is designed for desktop browsers and requires keyboard input. It may not work properly on mobile devices due to these limitations.