{"id":5997,"date":"2025-01-17T00:01:00","date_gmt":"2025-01-16T22:01:00","guid":{"rendered":"https:\/\/xeon.kapsi.fi\/mikko\/?p=5997"},"modified":"2025-10-08T19:25:50","modified_gmt":"2025-10-08T16:25:50","slug":"doom-pdf","status":"publish","type":"post","link":"https:\/\/xeon.kapsi.fi\/mikko\/2025\/01\/doom-pdf\/","title":{"rendered":"Doom PDF-tiedostona"},"content":{"rendered":"\n<p>Jos <a href=\"https:\/\/xeon.kapsi.fi\/mikko\/2025\/01\/tetris-pdf\/\" data-type=\"post\" data-id=\"5989\">Tetriksenkin pelaaminen onnistuu PDF-tiedoston sis\u00e4ll\u00e4<\/a>, miksei sama voisi onnistua my\u00f6s <a href=\"https:\/\/github.com\/ading2210\/doompdf\" data-type=\"link\" data-id=\"https:\/\/arstechnica.com\/gaming\/2025\/01\/this-pdf-contains-a-playable-copy-of-doom\/\" target=\"_blank\" rel=\"noreferrer noopener\">Doomin kanssa<\/a>? Pelih\u00e4n on aikojen saatossa saatu py\u00f6rim\u00e4\u00e4n mit\u00e4 mielikuvituksisimmissa paikoissa ja nyt jatkoa seuraa. Pelin \u00e4\u00e4ni- ja v\u00e4rimaailma on <a href=\"https:\/\/doompdf.pages.dev\/doom.pdf\" data-type=\"link\" data-id=\"https:\/\/doompdf.pages.dev\/doom.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">t\u00e4ss\u00e4 PDF-versiossa<\/a> hieman rajoittunutta ja ruudunp\u00e4ivitysnopeus ei yll\u00e4 huipputasolle, mutta n\u00e4m\u00e4 pienet puutteet on helppo antaa anteeksi.<\/p>\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"lyte-wrapper\" title=\"Doom (1993) in a PDF file\" style=\"width:1280px;max-width:100%;margin:5px;\"><div class=\"lyMe hidef\" id=\"WYL_g6ygXHmtHzs\" itemprop=\"video\" itemscope itemtype=\"https:\/\/schema.org\/VideoObject\"><div><meta itemprop=\"thumbnailUrl\" content=\"https:\/\/i.ytimg.com\/vi\/g6ygXHmtHzs\/maxresdefault.jpg\" \/><meta itemprop=\"embedURL\" content=\"https:\/\/www.youtube.com\/embed\/g6ygXHmtHzs\" \/><meta itemprop=\"duration\" content=\"PT2M17S\" \/><meta itemprop=\"uploadDate\" content=\"2025-01-13T01:03:45Z\" \/><\/div><div id=\"lyte_g6ygXHmtHzs\" data-src=\"https:\/\/i.ytimg.com\/vi\/g6ygXHmtHzs\/maxresdefault.jpg\" class=\"pL\"><div class=\"tC\"><div class=\"tT\" itemprop=\"name\">Doom (1993) in a PDF file<\/div><\/div><div class=\"play\"><\/div><div class=\"ctrl\"><div class=\"Lctrl\"><\/div><div class=\"Rctrl\"><\/div><\/div><\/div><noscript><a href=\"https:\/\/youtu.be\/g6ygXHmtHzs\" rel=\"nofollow\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.ytimg.com\/vi\/g6ygXHmtHzs\/0.jpg\" alt=\"Doom (1993) in a PDF file\" width=\"1280\" height=\"700\" \/><br \/>Watch this video on YouTube<\/a><\/noscript><meta itemprop=\"description\" content=\"I made a Doom source port that runs within a PDF file. Play it here: https:\/\/doompdf.pages.dev\/doom.pdf The PDF file format supports Javascript with its own separate standard library. Modern browsers (Chromium, Firefox) implement this as part of their PDF engines. However, the APIs that are available in the browser are much more limited. It turns out that old versions of Emscripten can compile C to asm.js code that will happily run inside the limited JS runtime of the PDF engine. I used the doomgeneric (https:\/\/github.com\/ozkl\/doomgeneric) fork of the original Doom source, as that made writing the IO fairly easy. All I had to do was implement a framebuffer and keyboard inputs. Unlike previous interactive PDF demos, the output for DoomPDF is achieved by creating a text field for each row of pixels in the screen, then setting their contents to various ASCII characters. This gives me a 6 color monochrome display, that can be updated reasonably quickly (80ms per frame). The source code is available at: https:\/\/github.com\/ading2210\/doompdf Note that this PDF can only run in Chromium-based browsers that use the PDFium engine.\"><\/div><\/div><div class=\"lL\" style=\"max-width:100%;width:1280px;margin:5px;\"><\/div><figcaption><\/figcaption><\/figure>","protected":false},"excerpt":{"rendered":"<p>Jos Tetriksenkin pelaaminen onnistuu PDF-tiedoston sis\u00e4ll\u00e4, miksei sama voisi onnistua my\u00f6s Doomin kanssa? Pelih\u00e4n on aikojen saatossa saatu py\u00f6rim\u00e4\u00e4n mit\u00e4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[528],"tags":[374,519,401],"class_list":["post-5997","post","type-post","status-publish","format-standard","hentry","category-nettiapaja","tag-doom","tag-pdf","tag-video"],"_links":{"self":[{"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/posts\/5997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/comments?post=5997"}],"version-history":[{"count":2,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/posts\/5997\/revisions"}],"predecessor-version":[{"id":6022,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/posts\/5997\/revisions\/6022"}],"wp:attachment":[{"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/media?parent=5997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/categories?post=5997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xeon.kapsi.fi\/mikko\/wp-json\/wp\/v2\/tags?post=5997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}