Did You Know You Can Play Games in PDF Files?

breakout pdf chromePDFs are now known simply for being the most universal document (fixed layout or not), but as developer Omar Rizwan showed us recently, they are capable of so much more.

While researching Adobe’s PostScript programming language, Rizwan learned that PDFs can support things like audio and video annotations, embedded Flash, and custom math functions (including a Turing-incomplete subset of PostScript).

These features aren't supported by most of the 3rd-party PDF readers on Windows, Android, or iOS, but here's something fun: Chrome's own PDF reader does support "a tiny subset of the enormous Acrobat JavaScript API surface".

Rizwan found that Chrome supports just enough JS in PDFs to run basic games like Breakout, and he made this PDF as a roof of concept. He says the game only works in Chrome, which I can mostly confirm (it didn't work in either IE or Firefox - or in Play Books).

You can play the game by moving your mouse in the light blue area beneath the green paddle. This controls its movement.

Github via TNW

About Nate Hoffelder (11477 Articles)
Nate Hoffelder is the founder and editor of The Digital Reader: "I've been into reading ebooks since forever, but I only got my first ereader in July 2007. Everything quickly spiraled out of control from there. Before I started this blog in January 2010 I covered ebooks, ebook readers, and digital publishing for about 2 years as a part of MobileRead Forums. It's a great community, and being a member is a joy. But I thought I could make something out of how I covered the news for MobileRead, so I started this blog."

Leave a comment

Your email address will not be published.