!!Con 2020 - Playing Breakout… inside a PDF!! by Omar Rizwan
About this talk
Playing Breakout… inside a PDF!! by Omar Rizwan If you’re like me, you think of PDFs as basically benign creatures: they’re static documents where the author laid out some text and graphics, and when you open a PDF, all your PDF reader does is display that stuff. Maybe that was what PDFs were originally, but today, the PDF specification is… 1,310 pages, and a PDF can contain things like: embedded Flash audio and video annotations 3D object annotations (!) rich text forms using a subset of XHTML and CSS but most interestingly… JavaScript scripting (!!!!!!!) So I wrote a game in JavaScript that lives inside a PDF: when you open the PDF in Chrome, you can play Breakout! I’ll show some basics of the PDF standard, how you embed JavaScript, and then discuss the problems I ran into when making this game work. It turns out, for example, that Adobe’s PDF JavaScript has a completely different standard library from browser JavaScript – and Chrome’s PDF reader only implements a weird subset of Adobe’s libraries! I’ll talk about the wild hacks I needed for basic things like tracking the player’s mouse cursor and making the Breakout game’s display update over time. Omar Rizwan is fascinated by weird leftover details of file formats and by what those details say about a format’s history. He works as a researcher at Dynamicland in Oakland, California.
Topics covered
Stay Updated
Get notified about new features and conference additions.