[{"data":1,"prerenderedAt":917},["ShallowReactive",2],{"project-42645218":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":49,"post_text":52,"what":53,"said":77,"maker_in_thread":200,"shape":208,"grid":212,"attempts":881,"same_week":882,"maker_shows":18,"maker_hidden":910,"reader_version":911,"card":912},"42645218","pdftris","Tetris in a PDF","title","Show HN: Tetris in a PDF","https:\u002F\u002Fth0mas.nl\u002Fdownloads\u002Fpdftris.pdf","th0mas.nl","ThomasRinsma",1736429493,2025,1289,223,6,3837,1,"legend","games","browser tetris clone","other",[24,25,26,27,28],"tetris","pdf javascript","pdf game","pdfium","pdf.js","mixed",0.001,{"positive":32,"neutral":33,"mixed":34,"critical":35},23,47,8,22,100,{"idea":38,"execution":40,"privacy":43,"docs":46,"performance":47,"design":48},{"positive":39,"critical":18},10,{"positive":41,"critical":42},5,17,{"positive":44,"critical":45},0,4,{"positive":44,"critical":44},{"positive":18,"critical":44},{"positive":44,"critical":44},[41,18,50,50,18,50,51,18,41,44,44,44,50,45,18,44,44,45,51,50,41,45,41,51,50,51,45,45,50,50,51,45,51,51,51,41,50,50,50,18],3,2,"I realized that the PDF engines of modern desktop browsers (PDFium and PDF.js) support JavaScript with enough I\u002FO primitives to make a basic game like Tetris.\n\nIt was a bit tricky to find a union of features that work in both engines, but in the end it turns out that showing\u002Fhiding annotation \"fields\" works well to make monochrome pixels, and keyboard input can be achieved by typing in a text input box.\n\nAll in all it's quite janky but a nice reminder of how general purpose PDF scripting can be. The linked PDF is all ASCII so you can just open it in a text editor, or have a look at the source ",{"problem":54,"audience":60,"pricing":60,"motivation":61,"time_to_build":60,"stack":65,"openness":74,"stage":75,"team_size":76},{"value":55,"source":56,"evidence":57},"Shows that PDF engines' JavaScript can run a basic game like Tetris","maker",[58],{"id":59},"post",null,{"value":62,"source":56,"evidence":63},"Explore how general-purpose PDF scripting can be",[64],{"id":59},[66,70],{"value":67,"source":56,"evidence":68},"JavaScript (in PDF)",[69],{"id":59},{"value":71,"source":56,"evidence":72},"Python (generator script gengrid.py)",[73],{"id":59},"open_source","launched","unknown",{"praise":78,"objections":110,"requests":149,"questions":165,"alternatives":179},[79,95],{"value":80,"source":81,"evidence":82},"Impressive ingenuity and cleverness in working around browser restrictions","commenter",[83,87,91],{"id":84,"by":85,"text":86},"42656144","weinzierl","It's hard to overstate the ingenuity that went into this! Despite what people say in the comments here, both browsers really do not let you execute PDF JavaScript willy nilly.…",{"id":88,"by":89,"text":90},"42655648","LetsGetTechnicl","This is an affront against god. Good work.",{"id":92,"by":93,"text":94},"42646738","josefritzishere","Brilliant!",{"value":96,"source":81,"evidence":97},"Fun and amusing hack",[98,102,106],{"id":99,"by":100,"text":101},"42645811","maalber","This is hilarious",{"id":103,"by":104,"text":105},"42646703","nickcageinacage","So cool",{"id":107,"by":108,"text":109},"42647808","miningape","I just wish I could print this",[111,130,145],{"value":112,"source":81,"evidence":113},"Does not work in several viewers such as Evince, Safari, Preview and pdf.js",[114,118,122,126],{"id":115,"by":116,"text":117},"42647696","freedomben","You glorious bastard, what a cool project! This is already a contender for most hacker project of the year :-) (below is not serious) I would advise people against using this in…",{"id":119,"by":120,"text":121},"42648319","jiveturkey","didn't work in safari's embedded reader. no text either, just a blank page. or did i not wait long enough?",{"id":123,"by":124,"text":125},"42646995","alana314","Wow, I had no idea PDFs could be this dynamic. Doesn't work in Mac OS preview or quicklook but works great in chrome.",{"id":127,"by":128,"text":129},"42649360","lihaciudaniel","Doesn't work in pdf.js",{"value":131,"source":81,"evidence":132},"Security risk of executing JavaScript in PDFs",[133,137,141],{"id":134,"by":135,"text":136},"42648779","UniverseHacker","This is horrifying, PDFs should not be able to execute code.",{"id":138,"by":139,"text":140},"42649401","efitz","This is amazing and terrifying (I am a security engineer and parsing complex document formats is a never-ending treasure trove of vulnerabilities).",{"id":142,"by":143,"text":144},"42646967","meddah","Oops. I realized now, unknown PDFs are not safe.",{"value":146,"source":81,"evidence":147},"Printed copies lose the interactive controls",[148],{"id":115,"by":116,"text":117},[150,161],{"value":151,"source":81,"evidence":152},"Add Doom or more complex games",[153,157],{"id":154,"by":155,"text":156},"42650847","theginger","I hope to see this evolved into doom by the end of the year. And it better not be just monochrome",{"id":158,"by":159,"text":160},"42656264","shivekkhurana","But can it run Doom ?",{"value":162,"source":81,"evidence":163},"Color support",[164],{"id":154,"by":155,"text":156},[166,173],{"value":167,"source":81,"evidence":168},"How the maker got it working in Chrome",[169],{"id":170,"by":171,"text":172},"42651944","Uptrenda","OP, I still don't really understand how you got it to work in Chrome?",{"value":174,"source":81,"evidence":175},"Which environments and PDF viewers support it",[176],{"id":177,"by":85,"text":178},"42647035","\"It was a bit tricky to find a union of features that work in both engines [..]\" I am curious what the constraints are to make this work and in which environments it does? Does…",[180,187,194],{"value":181,"source":81,"evidence":182},"Atari Breakout PDF",[183],{"id":184,"by":185,"text":186},"42647199","internetter","Atari Breakout for PDF: https:\u002F\u002Fcdn.jsdelivr.net\u002Fgh\u002Fosnr\u002Fhorrifying-pdf-experiments@master\u002Fbreakout.pdf",{"value":188,"source":81,"evidence":189},"Flappy Bird PDF made with Claude",[190],{"id":191,"by":192,"text":193},"42649747","bwjx","This is awesome. Took a bit of prompting but was able to get a semi-working (only in Chrome) Flappy Bird out of Claude in ~10 minutes. Seems like the collision detection needs…",{"value":195,"source":81,"evidence":196},"Snake game in a resume PDF",[197],{"id":198,"by":171,"text":199},"42651658","I did the same but with snake: https:\u002F\u002Froberts.pm\u002Fresume.pdf (Game at bottom -- though only works in Firefox and adobe. Now I need to add chrome support, thanks op. lmao) Edit:…",{"comments":51,"answered":18,"key":201},[202,205],{"id":203,"text":204},"42647251","I barely looked at Adobe Reader so not sure about that one, it definitely does not work with this PDF though, likely because it's not compliant in several ways. Besides that I…",{"id":206,"text":207},"42648535","Oops, yeah :)",{"commenters":209,"max_depth":34,"maker_replies":51,"first_comment_mins":210,"lifespan_hours":211},176,50,165,[213,215,219,221,223,225,229,233,236,238,241,244,247,250,252,255,259,262,265,268,271,273,276,279,281,283,286,289,292,295,298,301,304,306,310,313,316,319,322,325,328,331,334,335,338,339,342,345,347,350,353,356,358,361,364,367,370,372,375,378,381,384,387,389,392,395,398,401,404,406,409,412,415,418,421,425,427,431,433,436,439,442,444,446,449,452,455,457,460,463,466,471,473,475,477,480,482,484,488,491,494,498,502,505,508,511,515,518,520,523,526,527,530,533,536,541,545,548,551,554,557,561,565,569,570,573,577,580,584,586,590,594,597,599,602,605,608,610,613,617,620,624,626,630,634,638,642,646,648,652,654,659,662,664,668,672,675,679,684,686,690,693,697,700,703,706,709,713,717,722,726,727,729,733,736,739,743,746,750,754,758,760,762,766,770,772,776,778,782,784,789,793,797,800,804,806,810,814,817,820,823,825,827,830,834,837,839,842,844,846,848,851,854,856,859,863,867,870,873,876,879],[84,44,41,214,85,44],"project\u002Fpositive\u002Fidea",[216,44,44,217,218,44],"42658076","commenter\u002Fneutral\u002Fnone","brumar",[220,44,44,217,85,44],"42659677",[222,44,44,217,218,44],"42660967",[224,44,44,217,85,44],"42661093",[226,18,44,227,228,44],"42646931","other\u002Fneutral\u002Fnone","MartinMond",[230,18,18,231,232,44],"42651431","project\u002Fcritical\u002Fexecution","ozaark",[234,18,44,227,235,44],"42653243","belowm",[115,51,50,237,116,44],"project\u002Fmixed\u002Fexecution",[239,51,44,217,240,44],"42648120","zknowledge",[242,51,44,217,243,44],"42650477","ChrisMarshallNY",[245,51,44,217,246,44],"42648195","nadis",[248,51,44,227,249,44],"42649119","ikari_pl",[251,51,44,217,246,44],"42649248",[253,51,44,227,254,44],"42654432","VagabundoP",[256,51,50,257,258,44],"42663947","project\u002Fneutral\u002Fnone","ddoice",[260,51,44,227,261,44],"42668645","pk-protect-ai",[263,51,50,257,264,44],"42648240","FpUser",[266,51,44,227,267,44],"42648304","woodrowbarlow",[269,51,44,227,270,44],"42648735","AlexanderTheGr8",[272,51,44,227,249,44],"42649154",[274,51,44,227,275,44],"42649677","necovek",[277,51,18,231,278,44],"42653414","ars",[280,51,44,227,275,44],"42658187",[282,51,44,227,278,44],"42676499",[284,51,44,227,285,44],"42677506","nbenitezl",[287,51,44,227,288,44],"42651128","pavon",[290,51,44,217,291,44],"42648587","martinflack",[293,51,50,257,294,44],"42648740","inetknght",[296,51,50,257,297,44],"42649049","LeonenTheDK",[299,51,44,217,300,44],"42649006","debo_",[302,51,44,217,303,44],"42649581","dmd",[305,51,50,257,275,44],"42649685",[307,51,50,308,309,44],"42649718","project\u002Fneutral\u002Fidea","ycombinatrix",[311,51,44,217,312,44],"42650666","lisper",[314,51,50,308,315,44],"42653214","dheera",[317,51,18,231,318,44],"42653694","atoav",[320,51,44,217,321,44],"42654071","martin_a",[323,51,44,217,324,44],"42655775","maurya_anand",[326,51,44,217,327,44],"42656488","4ggr0",[329,51,50,257,330,44],"42664188","niqmk",[332,51,44,217,333,44],"42723478","banzomaikaka",[184,50,44,227,185,44],[336,50,18,231,337,44],"42657349","a3w",[138,45,41,214,139,44],[340,45,44,227,341,44],"42649963","tashian",[343,45,44,227,344,44],"42650133","miohtama",[346,45,44,227,116,44],"42650722",[348,45,44,227,349,44],"42650767","hnlmorg",[351,45,44,227,352,44],"42650860","btown",[354,45,44,217,355,44],"42652297","Thorrez",[357,45,44,227,352,44],"42668787",[359,45,44,227,360,44],"42651447","siva7",[362,45,44,227,363,44],"42653587","saagarjha",[365,45,44,227,366,44],"42651580","Swizec",[368,45,44,227,369,44],"42652157","bawolff",[371,45,44,227,235,44],"42653283",[373,45,44,227,374,44],"42655926","erk__",[376,45,44,227,377,44],"42650455","neuroelectron",[379,45,44,227,380,44],"42650648","wayvey",[382,45,44,227,383,44],"42651749","mizzao",[385,45,44,217,386,44],"42651836","kccqzy",[388,45,44,217,363,44],"42653596",[390,45,44,227,391,44],"42657248","enews01",[393,45,44,227,394,44],"42660958","brettermeier",[396,45,44,227,397,44],"42663658","wastholm",[399,41,50,257,400,44],"42646798","bityard",[402,41,44,227,403,44],"42648243","unnouinceput",[405,41,44,227,218,44],"42648936",[407,41,44,227,408,44],"42649402","pimlottc",[410,41,44,227,411,44],"42649857","kzrdude",[413,41,18,231,414,44],"42649534","Aaron2222",[416,41,44,217,417,44],"42654571","jeffhuys",[419,41,44,227,420,44],"42658960","swyx",[422,41,44,423,424,44],"42702638","other\u002Fcritical\u002Fnone","andreamonaco",[88,16,41,426,89,44],"project\u002Fpositive\u002Fnone",[428,429,41,430,352,44],"42647129",7,"project\u002Fpositive\u002Fexecution",[134,34,18,432,135,44],"project\u002Fcritical\u002Fprivacy",[434,34,44,227,435,44],"42648926","cess11",[437,34,44,217,438,44],"42649536","belval",[440,34,44,227,441,44],"42653789","silon42",[443,34,44,227,321,44],"42654096",[445,34,44,227,435,44],"42657525",[447,34,44,227,448,44],"42651408","nejsjsjsbsb",[450,34,44,423,451,44],"42651817","crazygringo",[453,34,44,227,454,44],"42653443","fsckboy",[456,34,44,227,321,44],"42654090",[458,34,44,227,459,44],"42653478","tbraydn",[461,34,44,227,462,44],"42654681","ta1243",[464,34,44,227,465,44],"42657280","slig",[467,468,44,469,470,44],"42647124",9,"other\u002Fmixed\u002Fnone","chaps",[472,468,44,227,400,44],"42648459",[474,468,44,227,275,44],"42649704",[476,468,44,227,386,44],"42651844",[478,39,41,426,479,44],"42646884","seany",[191,481,50,237,192,44],11,[483,481,50,237,171,44],"42665447",[485,486,44,227,487,44],"42646890",12,"illegalmemory",[489,486,44,227,490,44],"42647902","autoexec",[492,486,44,217,493,44],"42649190","ykonstant",[495,496,41,426,497,44],"42651772",13,"toddm",[499,500,18,231,501,44],"42646788",14,"frizlab",[503,500,18,231,504,44],"42647338","anothername12",[506,500,44,217,507,44],"42648290","swiftcoder",[509,500,44,227,510,44],"42652780","p0w3n3d",[512,513,44,227,514,44],"42647418",15,"GaggiX",[177,516,50,517,85,44],16,"project\u002Fneutral\u002Fdocs",[203,516,44,519,11,18],"project\u002Fneutral\u002Fexecution",[521,516,44,217,522,44],"42649369","throwaway86530",[524,516,50,257,525,44],"42647629","KeplerBoy",[206,516,44,257,11,18],[528,42,41,214,529,44],"42650124","alphabet9000",[531,532,41,430,171,44],"42654139",18,[534,532,44,227,535,44],"42704092","stronglikedan",[537,538,41,539,540,44],"42649141",19,"maker\u002Fpositive\u002Fnone","kvirani",[542,543,18,231,544,44],"42649018",20,"random_i",[546,543,41,430,547,44],"42649047","grimgrin",[549,543,41,430,550,44],"42649113","cryptozeus",[552,543,50,519,553,44],"42649482","icameron",[555,543,50,519,556,44],"42650033","TMWNN",[558,559,50,519,560,44],"42652958",21,"8mobile",[562,35,44,563,564,44],"42650562","other\u002Fneutral\u002Fprivacy","krick",[566,35,44,567,568,44],"42650596","commenter\u002Fneutral\u002Fprivacy","BoingBoomTschak",[99,32,41,214,100,44],[571,32,44,217,572,44],"42646680","revskill",[574,32,50,575,576,44],"42646826","maker\u002Fmixed\u002Fidea","runnr_az",[578,32,44,579,116,44],"42647733","commenter\u002Fpositive\u002Fidea",[581,32,50,582,583,44],"42647900","project\u002Fmixed\u002Fidea","lucianbr",[585,32,44,227,507,44],"42648303",[587,588,18,432,589,44],"42647946",24,"potatoman22",[591,588,50,592,593,44],"42648375","project\u002Fneutral\u002Fprivacy","geor9e",[595,588,44,563,596,44],"42651215","sexy_seedbox",[598,588,44,563,593,44],"42651910",[600,588,44,563,601,44],"42652717","throwaway2037",[603,588,50,519,604,44],"42667520","grgergo",[606,588,44,563,607,44],"42648571","poincaredisk",[609,588,44,563,435,44],"42649076",[611,588,44,563,612,44],"42654994","sgerenser",[614,615,50,519,616,44],"42650086",25,"eximius",[618,619,18,231,417,44],"42654563",26,[621,622,50,308,623,44],"42657282",27,"rhokstar",[625,622,44,217,394,44],"42661034",[627,628,50,308,629,44],"42653626",28,"amunozo",[631,632,50,308,633,44],"42654698",29,"ReneFroger",[635,632,50,636,637,44],"42654874","project\u002Fneutral\u002Fperformance","vanderZwan",[639,632,41,640,641,44],"42678921","project\u002Fpositive\u002Fperformance","vk6",[643,644,44,227,645,44],"42660472",30,"kleiba",[154,647,50,308,155,44],31,[649,650,41,214,651,44],"42655364",32,"shekywakey",[198,653,41,214,171,44],33,[655,656,50,657,658,44],"42648184",34,"project\u002Fneutral\u002Fdesign","riffraff",[660,656,44,227,661,44],"42648829","pbhjpbhj",[663,656,50,657,218,44],"42649706",[665,666,50,667,116,44],"42650741",35,"maker\u002Fneutral\u002Fnone",[669,670,50,519,671,44],"42649792",36,"ilvez",[673,674,50,667,218,44],"42648656",37,[676,677,50,519,678,44],"42648940",38,"thih9",[680,681,50,682,683,44],"42650835",39,"maker\u002Fneutral\u002Fdocs","rgmerk",[123,685,50,519,124,44],40,[687,685,44,688,689,44],"42648449","other\u002Fneutral\u002Fdesign","danudey",[691,685,44,227,692,44],"42648880","audiodude",[694,695,50,519,696,44],"42656928",41,"ninalanyon",[698,695,50,519,699,44],"42664501","skykooler",[701,702,50,237,391,44],"42657214",42,[704,702,50,519,705,44],"42657344","jancek27",[707,702,50,519,708,44],"42657355","julian37",[710,711,41,214,712,44],"42654276",43,"Shinchy",[714,715,50,517,716,44],"42646839",44,"amytimed",[718,719,50,720,721,44],"42649619",45,"project\u002Fmixed\u002Fprivacy","luismedel",[723,724,18,231,725,44],"42650789",46,"casey2",[107,33,18,231,108,44],[170,728,50,519,171,44],48,[730,731,50,519,732,44],"42649556",49,"abdibrokhim",[734,210,50,519,735,44],"42652072","_bydex",[737,210,50,519,738,44],"42657021","wizzwizz4",[740,741,41,214,742,44],"42653817",51,"chimo777",[744,745,41,214,448,44],"42651416",52,[747,748,50,308,749,44],"42648752",53,"_joel",[751,752,50,720,753,44],"42650674",54,"0xKelsey",[755,756,18,231,757,44],"42699802",55,"oneandonley1",[119,759,18,231,120,44],56,[761,759,50,519,363,44],"42653618",[763,764,18,231,765,44],"42648693",57,"purpleidea",[767,768,41,539,769,44],"42648022",58,"izakfr",[127,771,18,231,128,44],59,[773,774,44,227,775,44],"42650015",60,"billiam",[158,777,50,308,159,44],61,[779,780,44,227,781,44],"42652005",62,"tamersalama",[103,783,41,426,104,44],63,[785,786,18,787,788,44],"42649278",64,"project\u002Fcritical\u002Fidea","pmarreck",[790,791,50,592,792,44],"42683333",65,"zombot",[794,795,18,231,796,44],"42652315",66,"weddingbell",[798,799,50,308,420,44],"42658948",67,[801,802,41,426,803,44],"42654813",68,"darkce",[92,805,41,214,93,44],69,[807,808,44,227,809,44],"42649959",70,"Thoreandan",[811,812,50,308,813,44],"42646837",71,"Fernicia",[815,812,44,227,816,44],"42647652","doublerabbit",[818,812,44,227,819,44],"42648143","phkahler",[821,812,44,227,822,44],"42649374","smj-edison",[824,812,44,227,819,44],"42679703",[826,812,44,227,661,44],"42648811",[828,812,44,227,829,44],"42648974","Someone",[831,832,50,308,833,44],"42647228",72,"mati365",[835,832,44,227,836,44],"42647276","bowmessage",[838,832,44,227,833,44],"42647385",[840,832,44,227,841,44],"42647433","andrea76",[843,832,50,308,833,44],"42647634",[845,832,44,227,689,44],"42648377",[847,832,44,227,749,44],"42648759",[849,832,41,430,850,44],"42647437","lxgr",[852,832,44,227,853,44],"42649656","segasaturn",[855,832,44,227,850,44],"42650373",[857,832,44,227,858,44],"42648610","openrisk",[860,861,18,231,862,44],"42646997",73,"cool-RR",[864,865,18,432,866,44],"42653888",74,"ustad",[868,865,44,563,869,44],"42653952","aoeb",[871,865,44,563,872,44],"42654066","phforms",[874,865,44,567,875,44],"42654126","vasco",[877,865,44,567,878,44],"42656740","aceazzameen",[142,880,18,432,143,44],75,[],[883,887,891,896,900,905],{"id":884,"name":885,"points":886,"category":20},"42644168","Factorio Blueprint Visualizer",450,{"id":888,"name":889,"points":890,"category":20},"42678754","DoomPDF",369,{"id":892,"name":893,"points":894,"category":895},"42666492","dockview",334,"dev_tools",{"id":897,"name":898,"points":899,"category":895},"42712666","ItsLaunched",246,{"id":901,"name":902,"points":903,"category":904},"42697346","BadWebsiteBlocklist",225,"productivity",{"id":906,"name":907,"points":908,"category":909},"42700852","marimo",204,"languages",false,"v2",{"id":913,"name":5,"line":6,"ai":910,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":44,"top":18,"kw":914,"maker":11,"domain":10,"tier":19,"attempts":44,"strip":915,"url":9,"mix":916,"praise":80,"objection":112,"sub":21},42645218,[24,25,26,27,28],"5133132150003410042354523244332422253331",[32,33,34,35],1794036667646]