back to article They've only gone and made Doom run in a PDF file

There is a race to see who can bend the PDF file format to do the most impressive thing. Considering the more-than-30-year-old shooter, Doom, has been ported to many unexpected places, it was inevitable it would turn up in a PDF file. The Portable Document Format (PDF) was developed to present documents in a manner that was …

  1. Pete 2 Silver badge

    How much ink?

    > the full specification for Javascript in PDFs was only ever implemented by Adobe Acrobat,

    So can you print it?

    1. RSW

      Re: How much ink?

      Only if you have a printer that can do a sheet of A4 every 80ms

      1. Lazlo Woodbine Silver badge

        Re: How much ink?

        That's 12.5 pages per minute, I think our WF-M21000 can slow down to that speed :)

        1. KittenHuffer Silver badge

          Re: How much ink?

          I make it 12.5 pages per second!

          You could just have 60 printers to spread the load!

          1. Lazlo Woodbine Silver badge

            Re: How much ink?

            Duh, maths failure!

            It'll happily print a page at 200dpi every 250ms, so maybe I need to use 4 printers to print alternate frames

            1. I am David Jones Silver badge

              Re: How much ink?

              And a *very* fast secretary to collect and show you the pages in the right order

              1. The commentard formerly known as Mister_C Silver badge

                Re: How much ink?

                or a Vegas dealer to riffle shuffle

        2. Stuart Castle Silver badge

          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.

          1. Chloe Cresswell Silver badge

            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.

            1. robinsonb5

              Re: How much ink?

              Yup, I've used a number of Fiery-equipped colour photocopiers and "light-production digital presses" (which is what you call a colour photocopier when you want to charge three times as much for it) over the years. The first had a freestanding Fiery RIP like you describe - it was a quirky little box, tapered in odd ways, like a cartoon characature of a small tower case.

              The others have all been installed internally (which is a kind way of saying "bolted crudely to the side of the machine").

              I have to admit the RIP itself produces excellent results (modulo one version that would choke on the dodgy PDFs produced by Apple Pages) but the Command Workstation is a poster child for software bloat.

              1. Chloe Cresswell Silver badge

                Re: How much ink?

                This replaced a 2 colour copier, as it you could use black and one other colour depending on which cartridge/dev/drum was slotted in. We had red and green options. Compared to that, this was amazing when coupled with Corel Draw! 3... And it's clip art gallery which we had the CD version in a single speed CD ROM... and manual/gallery book, which you could have used to prop up a car!

          2. Lazlo Woodbine Silver badge

            Re: How much ink?

            We had a large Agfa printer, it was fine for the first few hours each day, then someone would send it a job it didn't like, usually an A5 stapled booklet or something similar, and it would become a shredder for a while...

            1. J. Cook Silver badge
              Joke

              Re: How much ink?

              They forgot to turn that option off in the print preferences. :: snicker ::

    2. J. R. Hartley

      Re: How much ink?

      A spokesman said, "This is the one thing we didn't want to happen".

  2. Alumoi Silver badge

    Only works in Chrom*.

    So it's not really a PDF, is it?

    1. ChrisC Silver badge

      Is that a limitation only raised on the project website itself, because it's not mentioned anywhere within the article? And yes, it IS really still a PDF, albeit one which is relying on some specifics of PDF viewer implementation that many of us might not even have been aware were a thing, and wouldn't won't necessarily work properly/at all (as the article alludes to) on *all* PDF viewers.

      1. m4r35n357 Silver badge

        So, not portable.

        1. matjaggard

          As someone who's worked on PDF software I can confirm that PDFs have never been and will never be portable. By which I mean that the spec is so complex that no renderers stick to the format - most just copy what Acrobat does and ignore the spec where they vary.

      2. Anonymous Coward
        Anonymous Coward

        Which part of the Portable Documents Format do you have trouble comprehending?

        As per Adobe: PDF is an abbreviation that stands for Portable Document Format. It's a versatile file format created by Adobe that gives people an easy, reliable way to present and exchange documents - regardless of the software, hardware, or operating systems being used by anyone who views the document.

        1. ChrisC Silver badge

          No need to be obnoxious. Does this particular PDF adhere to the specification for a PDF? It appears so, yes. Is it therefore a PDF, regardless of how impractical or how far removed from the original concept of a PDF it might be? Yes.

          1. Anonymous Coward
            Anonymous Coward

            As long it doesn't display its content in anything else BUT Chrom*, it is NOT a PDF

            1. TRT

              Well if you're going to quibble about the definition of Portable, I'M going to quibble about the definition of Document.

        2. veti Silver badge

          If that were even mostly true, there wouldn't be any such thing as a "Javascript implementation" in PDF.

          They lost sight of that mission long ago.

        3. FirstTangoInParis Silver badge

          Perhaps you’ve never tried writing standards. A camel would be a good outcome for a team writing a spec for a long range horse. But someone will have wanted to add all kinds of features and the team didn’t want to waste two years arguing the toss, so they went in as options. Hence a camel could also be fitted with wings, jet engines and aqualungs, but most aren’t.

    2. TangoDelta72
      Terminator

      A Barbarian's quote

      Conan:

      "Chrom* [sic], I have never prayed to you before. I have no tongue for it. No one, not even you, will remember if we were good men or bad. Why we fought, and why we died. All that matters is that today, two stood against many. Valor pleases you, so grant me this one request. Grant me revenge! And if you do not listen, the HELL with you!"

      Icon --> because, well, you know.

  3. richardcox13
    Go

    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 :-)

    1. lglethal Silver badge
      Trollface

      Re: Is there anywhere Doom has not been implemented?

      Implementations have never failed. They just havent been successful YET! :P

    2. The commentard formerly known as Mister_C Silver badge

      Re: Is there anywhere Doom has not been implemented?

      Two spring to mind -

      20+ years ago I saw a web page where the writer had gutted a CRT monitor and printed the various sprites on art board. Put them together like a Victorian childrens' theatre. Frame rate was measured in dpf (days per frame).

      Fairly recently I read another account on t'web where the writer declared that an attempt to "render frames using LED strips and a Raspberry Pi"... didn't work. IIRC the summary of the paper was "the less said about that, the better." Shame, might've been a fun read [hint, hint to the Contributing Editor]

      1. matjaggard

        Re: Is there anywhere Doom has not been implemented?

        I assumed it was how you could tell if a machine was Turing-complete.

    3. Tom66

      Re: Is there anywhere Doom has not been implemented?

      People have got DOOM to run on tiny microcontrollers that are found in printers, so short of the most basic microcontroller with no UI (like a washing machine) I'd be tempted to say it's possible to run Doom anywhere you can get a graphic display up and running and just about enough space for the art assets. You can trim stuff like the sound out and maybe remove all but the first level, but a bit like the Ship of Theseus, how much of DOOM can you remove before it is not DOOM?

  4. Anonymous Coward
    Anonymous Coward

    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.

    1. Lee D Silver badge

      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.

    2. Pascal Monett Silver badge

      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.

      1. Dan 55 Silver badge

        And you can even rotate PDFs, which Adobe now make you pay a subscription for.

        1. Mishak Silver badge

          Really?

          Glad I stopped using it a long time ago...

      2. Mint Sauce
        Thumb Up

        <AOL>Me too!</AOL>

        Not sure how I sneaked it onto my managed laptop but I'm glad it's evaded the 'unapproved software' police so far ;-)

        I use a browser for anything more complicated - e.g. a PDF form that needs to be filled in.

    3. BenDwire Silver badge

      It's been too many years for clear memories, but I seem to recall that you could turn off Javascript in settings. That was in the V6 release, eons ago, and I would expect it's still in there somewhere.

      There was never any good need for scripting in a PDF IMO, but these things happen. As others have pointed out, the core functions are easily handled by other programs now, and I only have Acrobat in a dusty VM that rarely sees any action ... buy I am tempted to waste a hour or two with this PDF!

      1. PRR Silver badge

        > I seem to recall that you could turn off Javascript in settings.

        Actually called Edit, Preferences. It is still there in my copy, which I use daily, and hasn't been turned-on in nearly a decade.

        Also this copy of Reader will rotate for free. One of the many reasons I refuse to update/downgrade and hoard an Old Copy to deploy on new machines.

        https://i.postimg.cc/ZWj4WX0Y/AReader-XI.gif

    4. Crypto Monad Silver badge

      robbing me from the illusion that PDFs were benign in terms of safety.

      Where did you get that illusion from? Malware-ridden PDFs have been a thing for ever. If you want safety, open PDFs inside a disposable VM.

    5. joeldillon

      The spec is something like 1500 pages. Even if it weren't for the scripting, that's a plenty big attack surface, unfortunately.

    6. GNU Enjoyer
      Angel

      Unfortanately, pdf JavaScript is supported on systemd/Linux

      The mupdf pdf toolkit supports JavaScript - thankfully you can compile out such a massive freedom and security liability.

      At least unlike postscript, pdf's without JavaScript are fixed function.

      >a browser's PDF engine.

      Those are shoddily written in JavaScript and undoubtably vulnerable to exploits and often support pdf JavaScript

    7. Anonymous Coward
      Anonymous Coward

      An industry insider comments...

      Just for the record, everyone in the PDF industry is well aware of the issues with JS, but we also know it's useful for form validation. There's a declarative replacement being worked on which is going to give you the same benefits for form processing but without needing a general Turing machiine to run. Early days but already showing a lot of promise.

      JS obviously has problems, but it's worth noting that I can't remember a specific PDF vulnerability that used JS as an exploit - most recent ones have been attacks on binary blobs in PDF such as fonts, image formats etc. However PDF JS spec is very Acrobat specific, so most vendors either don't implement it or (like us) implement only a subset, meaning demos like this - great, but terrible demos - don't run everywhere. Hopefully this declarative replacement is going to improve that.

      Anon, obviously!

      1. Jonathon Green
        Trollface

        Re: An industry insider comments...

        Pretty sure that PDF constitutes a Turing complete programming language even without the dirty little secret which is JavaScript (or the Lisp/Postscript like function interpreter)…

        1. joeldillon

          Re: An industry insider comments...

          The PostScript function generator (which is Forth-like, not LISP-like) is very specifically limited to a small number of operators such that it is not Turing complete. In particular you get no control transfer instructions other than, iirc, if/else.

          Not sure that PDFs as a whole are Turing complete for similar reasons. It's just a really complex spec.

          1. Anonymous Coward
            Anonymous Coward

            Re: An industry insider comments...

            PostScript functions in PDF are indeed limited, although displaying PDF also requires a full(*) PostScript interpreter for Type 1 fonts. Not full enough to include filesystem operations of course, that would be crazy!

            PDF is categorically not Turing complete, by design. PostScript is a programming language with multiple stacks, branching, dynamic function definition etc, while PDF is a document and container format - there's no stack, no branching, just a predefined set of draw operations.

    8. Jonathon Green
      Trollface

      “ robbing me from the illusion that PDFs were benign in terms of safety.”

      This is a joke right?

      I owe 12 years of gainful employment (up until my retirement just before Christmas) to the fact that if you custom designed a file format to act as a malware delivery vehicle you’d probably end up with PDF…

      1. find users who cut cat tail

        If you did it on purpose, you'd probably end up with MS OLE and ruin a bunch of file formats at once. But for a single format PDF comes pretty close.

    9. david 12 Silver badge

      robbing me from the illusion that PDFs were benign

      The definition of PDF also includes Post Script inclusions, although AFAIK Adobe never implemented that in their products -- their products render PS as raster, then include the object in the PDF.

      AFAIK PDF does not define any bit-map primitives -- that's why you need character representation, or Post Script, or rasterized graphics. But apart from that major limitation, it's still and always has been a script language, with all the potential problems that suggests.

    10. Anonymous Coward
      Anonymous Coward

      Cough splutter ...

      "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."

      [.pdf <===> 'safety' ... does not compute !!!???]

      Please let me know ***where*** the rock you have been living under exactly is !!!!

      It appears to be safe, secure, extremely secluded and well away from the 'interWebs' ... with the Trumpf years about to start AGAIN it would be a good place to be !!!

      <jk>

      :)

    11. Jon 37 Silver badge

      The safe, sane subset of PDF is called PDF/A. It just lets you have a document you can view and print, which is what most people using PDF files want.

      The full PDF spec has extensions for video, scripting, forms, DRM, encryption, digital signatures, and more. Some people want and use those features. Most don't.

    12. TRT

      Rather like its grandfather PS, it's very not benign. You could doorstop printers permanently using a file crafted to do that job. I think it took something like 8 bytes to achieve a very effective bricking.

  5. thod

    gif and video

    Honestly what is missing in pdf is gif and video support (like html) as it would me much more compelling as a presentation support

    And it would much easier to ditch powerpoint.

    Maybe if it can play doom it can play video file or gif using canvas ?

    1. m4r35n357 Silver badge

      Re: gif and video

      I agree - every program should do everything ;)

    2. Anonymous Coward
      Anonymous Coward

      Re: gif and video

      PDF has video already, and also audio and 3D graphics. The video, unfortunately, is roughly where it was in browsers 15 years ago - there, in theory, but codecs are keeping it from being widely compatible. There are a few other issues too (relating to some premature deprecations in PDF2.0), but there's not a lot of industry clamour for video so it's lower priority than improvements to the 3D, which is current work.

    3. katrinab Silver badge
      Flame

      Re: gif and video

      I prefer to use pdf as a portable document file [yes I know the f means format not file], and use other things for presentations.

  6. steviebuk Silver badge

    I would like to see

    Professor Brailsford do a talk on this on computerphile. All his PDF talks have been interesting as he was around for the birth of it all. Listening to his chats on fonts when they were a new thing and just being able to print special characters, finally, like chess pieces. Worth a watch.

  7. lglethal Silver badge
    Trollface

    In the far distant future...

    The alien Archeologists digging through the ruins of our long extinct civilisation, will come to the conclusion that mankind fought a long and ultimately losing battle against Otherworldy Demons. The evidence of this will be based on the sheer number of instances of Doom they find.

    There will be naturally some confusion as to the lack of fossils for the Demons, but since Doom guy doesnt tend to leave a corpse lying around, they will likely simply put it down to the Demons having soft bodies or some such.

    Or perhaps it will be considered a coming of age ritual to go and fight the demons. Because everything in Archeology is put down to a ritual if they cant work out a practical answer...

    1. David 132 Silver badge
      Thumb Up

      Re: In the far distant future...

      > Because everything in Archeology is put down to a ritual if they cant work out a practical answer...

      …or that other go-to explanation, “a fertility cult”.

      1. Joe Zeff
        Devil

        Re: In the far distant future...

        I can just see some far-future archeologist explaining the Holocaust as some militaristic ritual requiring vast masses of sacrifice followed by the burning of the bodies, rather like what the Aztecs did. And, they'd point to all the swastikas as evidence, calling them religious symbols.

        1. mtp

          Re: In the far distant future...

          Charles Stross is ahead of you there. This is almost literally the plot of The Atrocity Archives.

          https://www.goodreads.com/book/show/101869.The_Atrocity_Archives

      2. Anonymous Coward
        Anonymous Coward

        Re: In the far distant future...

        Thinking back to my Doom playing days and how successful I was with the MOS at the time, it's more like an anti-fertility cult.

  8. SuperGeek

    Just because you can.....

    Doesn't mean you should.

    1. Evil Auditor Silver badge

      Re: Just because you can.....

      Agree. But, does it run Crysis?!

  9. robinsonb5

    Impressive as this is, it's horrifying that it's possible!

  10. Cmdr Bugbear

    There are many reasons to dispeair in this timeline...

    ...this is NOT such a reason.

    Impressive stuff.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like