Weekly News

Did you know you can play games in PDF files?

November 30,-0001 00:00

PDFs are great for sending official documents while maintaining their formatting – but developer Omar Rizwan recently discovered that they can also be used for playing simple games. While learning about Adobe's PostScript programming language, Rizwan ...and more »


PDFs are great for sending official documents while maintaining their formatting – but developer Omar Rizwan recently discovered that they can also be used for playing simple games.
While learning about Adobe’s PostScript programming language, Rizwan discovered that PDFs can include things like embedded Flash components, 3D objects and JavaScript. However, most PDF readers don’t support these – but Chrome implements a small subset of the Acrobat JavaScript API surface.
What that means is that you can embed and run limited bits of JavaScript in your PDFs. So Rizwan dug up a tutorial on coding the classic arcade game Breakout and put it in a PDF. You can play it by visiting this link to his PDF file on Chrome.
To play, simply move your mouse horizontally in the light blue area beneath the green paddle to control its movement.
Wondering how he did it? The paddle, ball and bricks are all actually text fields. There’s a bit of clever scripting involved, but it should be fairly straightforward to figure out from the JavaScript file in Rizwan’s GitHub repository.

Horrifying PDF Experiments
on Omar Rizwan (GitHub)

Read next:

Twitter is testing 2 new customer service features that brands will love

gamestop games games done quick gamestop hours games for girls gamespot games with gold games of thrones games for kids gamestop trade in

Share this article

Related videos

FLAPPY BIRD - DONT PLAY THIS GAME!
FLAPPY BIRD - DONT PLAY THIS GAME!
Drake - Hotline Bling
Drake - Hotline Bling

DON'T MISS THIS STORIES