Run DOOM PDF File
We know that DOOM runs on electric toothbrushes, but what about a PDF file? The answer to that would be a resounding yes, albeit a very pixelated version. This is made possible because C code can be compiled to run within a PDF using and old version of Emscripten that targets asm dot js instead of WebAssembly.



Since C code can be compiled to run within a PDF file, the next step was figuring out a way to get key inputs, and a framebuffer for the output. Github user Ading2210 utilized Chromium’s PDF engine to solve those issue, as it supports both text fields and buttons. However, achieving a good looking framebuffer that is fast enough for gameplay was a bit of a challenge. Have a few minutes to burn? Try it out here.

Sale
KAMRUI E3B Mini PC, AMD Ryzen 5 7530U, 16GB LPDDR4X, 512GB SSD | Up to 4.5GHz, Mini Gaming PC, Triple 4K...
2,388 Reviews
KAMRUI E3B Mini PC, AMD Ryzen 5 7530U, 16GB LPDDR4X, 512GB SSD | Up to 4.5GHz, Mini Gaming PC, Triple 4K...
  • Powerful Mini Computer: KAMRUI E3B Mini PC with AMD Ryzen 5 7530U (6 cores, 12 threads), Zen 3 architecture, 15W TDP, up to 28W, base clock frequency...
  • Full-Function Type-C Port: This Mini Gaming PC includes a full-function Type-C port that supports charging, data transfer (10Gbps), and 4K/60Hz...
  • Expandable Storage: The KAMRUI E3B mini PC comes standard with 16GB of LPDDR4X memory (non-upgradeable). It also has two M.2 2280 SSD slots: one...

The full specification for the JS in PDFs was only ever implemented by Adobe Acrobat, and it contains some ridiculous things like the ability to do 3D rendering, make HTTP requests, and detect every monitor connected to the user’s system. However, on Chromium and other browsers, only a tiny amount of this API surface was implemented, due to obvious security concerns. With this, we can do whatever computation we want, just with some very limited IO,” said the developer.

Author

When it comes to cars, video games or geek culture, Bill is an expert of those and more. If not writing, Bill can be found traveling the world.