They've only gone and made Doom run in a PDF file
- Reference: 1736847007
- News link: https://www.theregister.co.uk/2025/01/14/doom_delivered_in_a_pdf/
- Source link:
The Portable Document Format (PDF) was developed to present documents in a manner that was independent of the software, hardware, and operating system showing them. It's an undoubtedly neat system, but malware authors [1]have been known to exploit its complexity .
[2]
id Software's Doom in a PDF – click to enlarge
However, what for one person is an opportunity for mischief is for another a demonstration of programming prowess, which brings us to [3]DoomPDF , a port of the classic first-person-shooter that will run from a PDF, assuming the PDF engine used to display the document at least partially supports PDF file format's implementation of Javascript.
The Reg ran the PDF in a Chromium browser and, purely in the interest of research, spent perhaps more time than we should making sure the monochrome rendering of '90s mayhem worked as we remembered.
According to the author, Github user ading2210 , the full specification for Javascript in PDFs was only ever implemented by Adobe Acrobat, while Chromium and other browsers implemented a subset of the API surface due to security concerns. However, there is enough there to coax all manner of interactivity into life for the determined and skilled.
[4]
As for how it works, it's possible to compile C code to run in a PDF; key inputs can be grabbed and a framebuffer used for output – something the author described as a challenge.
[5]
[6]
Doom's 320 x 200 resolution meant that using individual text fields as pixels wasn't really feasible (this writer attempted to render frames using LED strips and a Raspberry Pi several years ago and… the less said about that, the better.) Instead, the port uses a separate text field for each row on the screen and sets its contents to various ASCII characters.
"I managed to get a 6 color monochrome output this way, which is enough for things to be legible in-game. The performance of this method is pretty poor but playable, since updating all of that text takes around 80ms per frame," says the dev.
[7]
While the frame rate might make hardcore gamers weep, it's plenty fast enough to wade Knee-Deep in the Dead.
The author said they were inspired by [8]pdftris by Thomas Rinsma, which, as the name implies, is Tetris in a PDF. Rinsma has also attemped to [9]bring Doom to life in PDF form but praised DoomPDF with [10]"Great work!"
It is indeed great work and an example of some impressive ingenuity. It also highlights that PDFs are not necessarily static items, for better... or for worse.
[11]
Take care when opening a PDF, even if it promises an afternoon of '90s pixel-based action. ®
Get our [12]Tech Resources
[1] https://www.theregister.com/2022/05/24/hp-pdf-phishing-malware/
[2] https://regmedia.co.uk/2025/01/13/doom.jpg
[3] https://github.com/ading2210/doompdf
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Z4ZD2CqfLBQIO550D_8bIwAAARM&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Z4ZD2CqfLBQIO550D_8bIwAAARM&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Z4ZD2CqfLBQIO550D_8bIwAAARM&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Z4ZD2CqfLBQIO550D_8bIwAAARM&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[8] https://github.com/ThomasRinsma/pdftris
[9] https://th0mas.nl/2025/01/12/tetris-in-a-pdf/
[10] https://news.ycombinator.com/item?id=42680801
[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Z4ZD2CqfLBQIO550D_8bIwAAARM&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[12] https://whitepapers.theregister.com/
Re: How much ink?
Only if you have a printer that can do a sheet of A4 every 80ms
Re: How much ink?
That's 12.5 pages per minute, I think our WF-M21000 can slow down to that speed :)
Re: How much ink?
I make it 12.5 pages per second!
You could just have 60 printers to spread the load!
Re: How much ink?
Not sure what model it was, but we used to have a large Agfa printer that took up a sizeable percentage of the available space in the room it was in. It printed out somewhere in the range of several thousand pages a minute , and it earned it's nickname, Fiery.
TBH, I'm not really sure of the specs either, as I had nothing to do with the printer, but it was bloody fast.
Re: How much ink?
Fiery was normally the RIP unit that controlled them - we had a "little" Firey XL which was the brains of a colour copier - the copier was roughly average sized (1.5x4 metres) for the time, the Firey sat to the side and was the size of a tower server. The cable between the two was impressive, it was about 2cm in diameter.
Only works in Chrom*.
So it's not really a PDF, is it?
Is there anywhere Doom has not been implemented?
It seems everything can run doom.... would it be more interesting to have stories on where implementations have failed :-)
The more shocking thing I learned from this is that Adobe supports JavaScript in PDF, robbing me from the illusion that PDFs were benign in terms of safety.
Luckily running Adobe Reader is next to impossible on Linux (and unless for visa, never needed), and so painful to interact with that I almost always use simple PDF readers or a browser's PDF engine.
For years.
Where have you been? Version 3.02 onwards! 1996 or thereabouts!
There's literally a box of options in the options dialog for it labelled Javascript.
I only use SumatraPDF.
It's good enough for me, and lightning quick.
It doesn't have all the bells and whistles, but hey, it's free.
And you can even rotate PDFs, which Adobe now make you pay a subscription for.
How much ink?
> the full specification for Javascript in PDFs was only ever implemented by Adobe Acrobat,
So can you print it?