Home Tetris continues to pack a punch, even in tiny 60K PDF format

Tetris continues to pack a punch, even in tiny 60K PDF format

It is the classic, iconic Tetris, but not as we know it.  

A security analyst has taken the humble PDF and managed to adapt a version of the ever-popular title into a 60KB PDF file that can work on any browser. 

As detailed by Tech Spot, Thomas Rinma is the brains behind this particular operation, dubbing his creation as “Pdftris”.

How does it work? Very simply. All you have to do is click to make the blocks fall into place, just like you did all those times before. Users can click the mouse to command the on-screen buttons, or alternatively, to use keyboard controls – WASD keys – to move, rotate, or drop. 

As you would expect, there are no bells or whistles on this type of Tetris. 

No colors, no sound, and no variety give a new feel to retro, but given the parameters he has worked within, it is still an impressive feat from Rinsma. 

Maybe he will develop Pdftris, but to get to this stage, the analyst deployed the lesser-used capability of PDF scripting, bolstered by JavaScript. 

What is under the hood?

The arduous task of delivering a working game/product was encouraged after Rinsma discovered he could make use of the PDF engines that are essential for browsers like Chrome and Firefox. 

This would be the basis for his achievement.

Many hours and struggles followed as he strived to get the game to render across various PDF engines. He had to adapt and overcome, but the show/hide functionality of PDF annotation provided the breakthrough to build the famous Tetris pixels.

It is an experiment but a job very well done. 

Interested users can take a look under the hood – spoiler, you will encounter the humble ASCII text – by downloading the PDF and viewing the code in an editor, or to visit Rinsma’s GitHub stash for more learning. 

Hopefully, more blocks will fall into place for this clever creator as he continues his innovative, developer journey.

 

Image credit: Via Midjourney

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech, gambling and blockchain industries for major developments, new product and brand launches, AI breakthroughs, game releases and other newsworthy events. Editors assign relevant stories to in-house staff writers with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Graeme Hanna
Tech Journalist

Graeme Hanna is a full-time, freelance writer with significant experience in online news as well as content writing. Since January 2021, he has contributed as a football and news writer for several mainstream UK titles including The Glasgow Times, Rangers Review, Manchester Evening News, MyLondon, Give Me Sport, and the Belfast News Letter. Graeme has worked across several briefs including news and feature writing in addition to other significant work experience in professional services. Now a contributing news writer at ReadWrite.com, he is involved with pitching relevant content for publication as well as writing engaging tech news stories.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.