A developer has utilised Adobe Acrobat’s support for JavaScript in PDF files to create a basic version of the classic video game Doom inside a PDF.
Although support for JavaScript in PDFs dates back decades and is documented in Adobe’s specifications, the company implemented it in a more limited and secure form in built-in PDF rendering engine PDFium, which is used in Chromium-based browsers.
The developer recompiled an old version of Doom’s open-source code using Emscripten, which outputs optimised asm.js code, and then loaded this into the PDF, allowing users to play the game by typing instructions into a text field that generates “video” output in the form of converted ASCII text fed into 200 individual text fields to simulate a playable version of the game.