12 ms·
Making a PDF that's larger than Germany
- markussss 3y agoThis was a fun read! Thank you
- tkgally 3y agoI second that comment! That was the most enjoyably nerdy thing I’ve read in quite a while.
- gr33nq 3y agoCoincidentally, I just finished watching a video that explored the same topic of massive and unique PDF files: https://www.youtube.com/watch?v=ZvVNRRQjDh8 https://www.youtube.com/watch?v=ZvVNRRQjDh8
- NooneAtAll3 3y agoyeah, I went here to post it as well not every time one can see a whole game integrated into a PDF!
- kepano 3y agoI cannot let this opportunity go by without quoting On Exactitude in Science by Borges in its entirety ". . . In that Empire, the Art of Cartography attained such Perfection that the map of a single Province occupied the entirety of a City, and the map of the Empire, the entirety of a Province. In time, those Unconscionable Maps no longer satisfied, and the Cartographers Guilds struck a Map of the Empire whose size was that of the Empire, and which coincided point for point with it. The following Generations, who were not so fond of the Study of Cartography as their Forebears had been, saw that that vast map was Useless, and not without some Pitilessness was it, that they delivered it up to the Inclemencies of Sun and Winters. In the Deserts of the West, still today, there are Tattered Ruins of that Map, inhabited by Animals and Beggars; in all the Land there is no other Relic of the Disciplines of Geography." https://en.wikipedia.org/wiki/On_Exactitude_in_Science https://en.wikipedia.org/wiki/On_Exactitude_in_Science
- deleted 3y ago[deleted]
- staplung 3y agoOr a portion of one of it's inspirations: Lewis Carroll's Sylvie and Bruno Concluded "We actually made a map of the country, on the scale of a mile to the mile!" "Have you used it much?" I enquired. "It has never been spread out, yet," said Mein Herr: "the farmers objected: they said it would cover the whole country, and shut out the sunlight ! So we now use the country itself, as its own map, and I assure you it does nearly as well."
- defrost 3y agoAlso Carroll, from The Hunting of the Snark He had bought a large map representing the sea, Without the least vestige of land And the crew were much pleased when they found it to be A map they could all understand. “What’s the good of Mercator’s North Poles and Equators,Tropics, Zones, and Meridian Lines?” So the Bellman would cry and the crew would reply “They are merely conventional signs! “Other maps are such shapes, with their islands and capes! But we’ve got our brave Captain to thank (So the crew would protest) that he’s bought us the best A perfect and absolute blank!”
- jancsika 3y agoThere are some funny lines from They Might Be Giants' "Women and Men" that run along the same lines: Women and men have crossed the ocean, They now begin to pour Out from the boat and up the shore. Two by two they enter the jungle, And soon they number more, Three by three as well as four by four. Soon the stream of people gets wider, Then it becomes a river, River becomes an ocean, Carrying ships that bear Women and men. ** Borges: map of an area gets so detailed it becomes the same size as the area. TMBG: creatures multiply and ultimately overrun an area so fully that their group behavior recreates the ecology of the area they took over
- iggldiggl 3y agoAnd Umberto Eco expanded on that with On the Impossibility of Drawing a Map of the Empire on a Scale of 1 to 1: https://s3.amazonaws.com/arena-attachments/881694/cb6119367bf63e879815ce2299d09995.pdf https://s3.amazonaws.com/arena-attachments/881694/cb6119367b...
- poulsbohemian 3y agoAbout 30 years ago I interviewed to be a summer intern at Microsoft, and one of the interviewers asked a question very similar to this but regarding Excel. This is the kind of topic that never gets old for understanding a person’s curiosity and ability to dissect the potential issues.
- drewcoo 3y agoPlease, nobody tell Randall Munroe! Because I would literally spend days worth of time scrolling.
- whoisthemachine 3y agoWhile the Germany PDF actually scrolls pretty quickly at 100% zoom (makes one realize just how much text is read in a day), the Universe one is pretty fun, Firefox's PDF reader at 100% zoom obviously doesn't budge the scrollbar at all.
- pitherpather 3y agoHackaday soon: Synchronizing a treadmill to a pdf the size of Germany. Obligatory?: The pdf is not the territory.
- mrb 3y agoFun experiment alexwlchan! Two small mistakes in your post: you write "15,000,000,000.00 in" and "that the size of a page is 15 billion inches", but it should be 15 million. You said you had difficulty formatting text. Here is a "hello world" pdf that just has these two words on a page: copy and paste this text (stripping leading spaces on each line) and save it in a .pdf file. Basically in order to write text you have to define a font (object 5) and then a stream with a Tf command to use the font, a Td command to position the text, and a Tj command to write it. %PDF-1.2 1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj 2 0 obj << /Type /Pages /Kids [ 3 0 R ] /Count 1 /MediaBox [ 0 0 612 792 ] >> endobj 3 0 obj << /Type /Page /Parent 2 0 R /Resources 4 0 R /Contents 6 0 R >> endobj 4 0 obj << /ProcSet[/PDF/Text] /Font << /F1 5 0 R >> >> endobj 5 0 obj << /Type /Font /Subtype /Type1 /BaseFont /Times-Roman >> endobj 6 0 obj << /Length 52 >> stream BT /F1 48 Tf 185 400 Td (Hello World)Tj ET endstream endobj trailer << /Root 1 0 R >>
- puck 3y ago> Please don’t try to print it. How will I know if I can fold it more than 7 times, though?
- whartung 3y agoIs the xref at the end of a PDF required or not? Seems like it is in the spec.
- mrb 3y agoIt is required according to the standard. But in practice most PDF viewers don't care. They may complain the PDF is "damaged" or "no valid xref was found", but they will render it perfectly fine.
- jchw 3y agoBy the spec, yes. Some PDF readers will parse it anyway, some will not. In my experience depending on the renderer the xref table can be varying degrees of malformed before things go wrong. Edge's old PDF reader (the one before Acrobat and after PDFium) for example seemed to tolerate just about anything, falling back to the latest version of objects if the xref table was broken. There's also other mistakes you can make, like for example, the xref table requires carriage returns (each entry in the table is supposed to be an exact number of bytes) but some PDF readers will still interpret the xref table even if the carriage returns are missing.
- anotheraccount9 3y agoFor a moment I wasn't sure if I wanted to click on the link.
- qwertox 3y agoIt also screams buffer overflow.
- maxerickson 3y agoPDF readers are probably mostly pretty hardened against "naive" non-conforming content.
- kirubakaran 3y ago> probably mostly pretty hardened Quite possibly perhaps that might be true-ish to some extent, I think, but take that with a grain of salt, I'm not an expert, that's just my wild guess :-p
- maxerickson 3y agoIt's pretty ridiculous to peel that off the following qualifier. Readers have been aggressively attacked for a long time. It's certainly not impossible that some basic demonstration PDF will cause an issue, but it's probably not reasonable to expect it.
- chaxor 3y agoOn an only slightly related note: is there any good way to check PDFs for malware/executables? If I'm stuck with an attempt at it, the best I can think of is opening in a new QEMU or docker with no Internet access, but that's 1) a fair but of work to check something, and 2) probably not even that secure. Using some cli tool, like xxx, bat, or ranger, that does some processing to extract the text and looking at just that feels more secure - but I know it really isn't. What is a simple tool to "clean" PDFs? An ML tool that does QEMU/docker/no-net to extract the content, turns that into game, and saves a typst/latex template with it would probably be the best possible outcome - but that's a decent (yet potentially very lucrative) task.
- whartung 3y agoIt seems germane at this point to paraphrase Steven Wright. “I have a map of the United States. It’s actual size. “
- fuzztester 3y agoI have a map of the Universe. Dunno, it keeps expanding ...........................................,............................................................................................................................
- galaxyLogic 3y agoI have the map of US in my cell-phone. I'm somewhat confused by its directions however when I look at the map and want to go somewhere. Is the top-part of the map where I'm moving? Or is the top-part North? Seems it is not North and that is confusing because maps I've seen before have North at the top always. If I turn 90 degrees, the map turns around. But I thought it was I who turned around. And if I stop, the map cannot know where I'm going because I'm not going anywhere. So it is almost like I have to start moving before the map can tell me where to turn. Or if I hold the smart-phone in front of my eyes the top of the map is towards the sky. Am I supposed to look at the map from above? What are some good tactics on how to use Google-map on your cell-phone?
- TowerTall 3y agoI really hate that too. You are in a intersection and the voice says "Drive north for x miles/km". What is wrong with "turn right and drive for x miles/km"? I normally have zero clue in what direction north is especially when I am in a location i have never been before. I drive a bike and have the phone in my pocket and can therefore not see any arrow that the app might display. I only have the audio to navigate from.
- jeffhuys 3y agoThat’s Google maps for you. Try another one, most have way better voice cues (amongst other things!).
- jdlyga 3y agoYou know you're reading a good technical article when it measures pdf width in kilometers
- oneseven 3y agoSlightly tangential: if you are hacking on PDFs, manually or otherwise, this is an incredibly useful tool: https://pdfcpu.io/ https://pdfcpu.io/ (not the author, just a user)
- vendiddy 3y agoThanks for this. Any other tools that are useful when hacking on PDFs? I need to do a lot of programmatic PDF manipulation at work.
- unsignednoop 3y ago[dead]
- tremarley 3y ago“But unlike Acrobat, the Preview app doesn’t have an upper limit on what we can put in MediaBox. It’s perfectly happy for me to write a width which is a 1 followed by twelve 0s: Screenshot of Preview’s Document inspector, showing the page size of 352777777777.78 x 10.59 cm. If you’re curious, that width is approximately the distance between the Earth and the Moon. I’d have to get my ruler to check, but I’m pretty sure that’s larger than Germany.” The size of every planet in our solar system, put next to each other, can fit in this doc with room to spare
- MichaelZuo 3y agoNow I wonder how large of a file size would such a PDF be if it wasn't empty space...
- pas 3y agopdf supports vector graphics! or it can be just a lot of "a" characters, it supports compression/repeat, right?
- croes 3y agoYou have one 7 too many. 352777777777.78cm are 3,527,777.7777778km.
- svantana 3y agoBy my counting, that document is ~ 373 km^2, which is much smaller than germany. It turns out the ruler was needed after all
- 0134340 3y ago>Please don’t try to print it. Sounds like a print bomb waiting to happen. Last time I had a printer it was next to impossible to cancel a print job on Windows. Back when people had wifi printers that were open or ill-secured, those were fun times.
- matheusmoreira 3y ago> it was next to impossible to cancel a print job on Windows It's still impossible. The only reliable method I've found consists of turning the printer off and then deleting the print job in the queue. Only way to get Windows to actually delete it. Doesn't work unless the printer is sitting right next to me, of course. I have no idea why this is so hard.
- askvictor 3y agoAnd sometimes windows won't delete it from the print queue as it can't talk to the printer. Fun times.
- tazjin 3y agoSome ~12 years ago, I was debugging POS integration with a receipt printer and accidentally sent garbage postscript to the receipt printer, which printed it out verbatim. Stopping it was impossible. Power cycling that printer had absolutely no effect. It wrote the unfinished print job to some kind of persistent memory, and by god it was going to finish it. It went through something like 2 1/2 rolls of receipt paper (yes it dutifully awaited the new rolls and then just continued) and due to the thermal printing process it smelled very odd, and I had quite a few metres of raw Postscript afterwards to decorate a wall with.
- foreigner 3y agoOnly slightly more reliable method: unplug the printer and throw the computer out the window.
- kome 3y agowhen i read > Please don’t try to print it. my first reaction has been: you are not my mom. >:-)
- xanth 3y agoRelated CGPGrey video comparing metric paper sizes to comparable objects from the plank scale to the galactic[1]; could have been an XKCD comic [1]: https://www.youtube.com/watch?v=pUF5esTscZI https://www.youtube.com/watch?v=pUF5esTscZI
- codeflo 3y agoI take offense to that diagram; Germany should refuse to be covered by a PDF that's not in proper DIN format. In theory, DIN paper sizes go all the way from subatomic to the size of the universe. It seems like A(-39) is barely too small to cover Germany's land mass, but A(-40) should be more than sufficient. That's 882 x 1247 km if I didn't miscalculate.
- macropin 3y agoReminds me of this PDF I created more than a decade ago from a Postscript implementation of the game of life. Seems it still works, but causes MacOS preview to crash. https://andrewcutler.net/docs/joke/life.pdf https://andrewcutler.net/docs/joke/life.pdf
- JKCalhoun 3y agoWhew! Didn't crash on my Mac OS — just a static Game of Life render. This machine is still on Monterey FWIW.
- maleldil 3y agoIt doesn't cause Preview to crash on Sonoma. FWIW, I can't see any animation, just the final state, while Firefox's PDF reader does show some animation. Skim has the same behaviour as Preview but doesn't show the grid.
- ipsum2 3y agoChrome's PDF reader reports the file size as disappointly 200.00 × 200.00 in (square)
- NAMMOI44K 3y ago[flagged]
- torbengee 3y ago[flagged]
- yannis 3y agoAnd of course you can try and produce this pdf using TeX. In this post https://tex.stackexchange.com/a/27482/963 https://tex.stackexchange.com/a/27482/963 I created a pdf of 15283 pages (lettersize) filled with lorem ipsum text and without the program running out of memory.
- wiradikusuma 3y agoI open the PDF in Google Chrome on a Mac. When I Ctrl+P, the dialog says it's 1 Page. I don't try to print it, but I think it will not consume more than 1 page? Also, PDF preview in Chrome simply showing it like a normal PDF, but Preview seems confused (gray background instead of white)?
- justsomehnguy 3y ago> I don't try to print it Well, you can even without consuming a single sheet: just print to PDF. > Preview seems confused (gray background instead of white)? It tries to render it and fit in the preview.
- nayuki 3y agoI'll analyze PNG for comparison. The largest width and height is 2147483647 (2^31 - 1). Using the pHYs chunk (physical pixel dimensions), the lowest density we can specify is 1 pixel per metre. So, 2 billion metres (2 gigametres) is somewhat bigger than the diameter of the sun at 1.39 Gm. https://en.wikipedia.org/wiki/Orders_of_magnitude_(length)#gigametre https://en.wikipedia.org/wiki/Orders_of_magnitude_(length)#g... Using the sCAL chunk (physical scale) would allow extremely large dimensions because it uses ASCII floating-point.
- lifthrasiir 3y ago> Using the sCAL chunk (physical scale) would allow extremely large dimensions because it uses ASCII floating-point. AFAIK sCAL is more about the image's subject, not the image itself. A 1:10,000,000 scale world map would be < 10 m wide according to pHYs, but it will be ~40,000 km wide according to sCAL.
- msarris 3y agoSo I guess the question is, how did she figure out the size of the entire universe?
- Simon_ORourke 3y ago[flagged]
- bowsamic 3y agowas? More like is. They're overlooking one right now, because of the last one they did.
- denysvitali 3y agoI can't wait for people to start rendering their CVs with this trick >:)
- roxgib 3y agoI'm a bit disappointed in myself that it didn't occur to me to submit my CV in A3.
- jl6 3y agoPDF is a fabulous format. I mean, it’s an awful format in so many ways, technically speaking, but the net effect of having a self-contained static file in your custody stands in blissful contrast to the user-hostile dynamic/SaaS website that can be taken away at a moment’s notice. PDF/A is the true PDF - it strips out most of the dangerous cruft. Anyway, if you like weird PDF hijinks, here’s a polyglot PDF/A CSV file that is also its own original soundtrack as a polyglot Amiga soundtracker mod: https://www.lab6.com/6 https://www.lab6.com/6
- throwaway290 3y agoDoes it anything else? Maybe pwn me via my PDF viewer?;)
- TeMPOraL 3y agoIt contains Bitcoin hashes, rendering them one by one as it mines them.
- martin_a 3y ago> PDF/A is the true PDF As someone working in the graphic industry, I'd say PDF/X is the true PDF, but ymmv. :-)
- amelius 3y agoPDF is an executable file. Many people are worried about running Javascript but still use PDF files without problems.
- JackSlateur 3y agoLong story short: the original tweet makes a confusion between PDF (the file format) and adobe acrobat (the PDF reader) : the 381km2 is an acrobat limit, not a PDF limit Funny document, still
- mr_mitm 3y agoInteresting, I always though Acrobat was the reference implementation of PDF.
- latexr 3y ago> Long story short: the original tweet I don’t think the tweet is relevant at all and it’s a disservice to this post to feature it that prominently in a summary. A more interesting conclusion is that PDF files can have dimensions larger than the Universe, and an example is provided.
- DontBreakAlex 3y agoWait, pdf files aren't binary ?!
- gaazoh 3y agoI just had the exact same reaction! So I opened a random PDF I had laying around, and yes, it's mostly a text format. Some (most) objects are binary data streams, but some are also text data. Likewise, objects may or may not be compressed, obviously compressed streams are binary data. But the file structure is text, some objects are xml, and you can figure out quite a lot of stuff just by looking at a pdf in a text editor, and it might not even be that long: the single page PDF I just looked at is just over 1500 lines long, I can definitely manually scroll through it (although offsets are in bytes, not lines, which make them not very useful for manual lookup).
- roxgib 3y agoI was surprised that the underlying format doesn't implement compression (though I assume objects can be compressed). Perhaps I shouldn't be surprised since I often get text only PDFs with unreasonably large sizes.
- theletterf 3y agoThis post reminds me of Umberto Eco's intellectual divertissements. More specifically, this fantastic piece, "On the Impossibility of Drawing a Map of the Empire on a Scale of 1 to 1." https://s3.amazonaws.com/arena-attachments/881694/cb6119367bf63e879815ce2299d09995.pdf https://s3.amazonaws.com/arena-attachments/881694/cb6119367b...
- alberto_ol 3y agoUmberto Eco quoted Jorge Luis Borges: https://en.wikipedia.org/wiki/On_Exactitude_in_Science https://en.wikipedia.org/wiki/On_Exactitude_in_Science
- remoquete 3y agoYes, though it'd be perhaps more accurate to say it expanded upon the theme, as Wikipedia says.
- B1FF_PSUVM 3y agoSpeaking of Borges, sometimes I'm sadly reminded of his spoof of categorization schemes ("Animals: those that belong to the Emperor, embalmed ones," etc. ) : https://en.wikipedia.org/wiki/Celestial_Emporium_of_Benevolent_Knowledge https://en.wikipedia.org/wiki/Celestial_Emporium_of_Benevole...
- danbruc 3y agoSo what is the actual limit if any? I just had a quick look at ISO 32000-2:2020 [1] and think the answer is none or implementation depended if you want. In the file format a media box is a rectangle, a rectangle is an array of four numbers, and a number is either an integer or a real. Numbers are represented as strings, so there is no a priori limit on their range and there seem to be no requirements on the minimum or maximum range of values an implementation has to support. The appendix only says that IEEE 754 is a commonly used format to represent reals and that this might impose limits. [1] https://developer.adobe.com/document-services/docs/assets/5b15559b96303194340b99820d3a70fa/PDF_ISO_32000-2.pdf https://developer.adobe.com/document-services/docs/assets/5b...
- RecycledEle 3y ago"Your Scientists Were So Preoccupied With Whether Or Not They Could, They Didn’t Stop To Think If They Should." --Ian Malcolm in the original Jurassic Park film
- _bax 3y agoAn idea to send a DDOS attack to company LAN printers
- mglz 3y agoWouldn't they just check their available paper, notice there is no AGermany size and give up?
- jakey_bakey 3y agoI love the texture of your website, it's like nice tactile wallpaper.
- JKCalhoun 3y agoLooks like it's: https://alexwlchan.net/theme/white-waves-transparent.png https://alexwlchan.net/theme/white-waves-transparent.png
- poulpy123 3y agowhat does mean "larger than germany" for a document file ?
- 654wak654 3y agoPDFs have physical dimensions in them (I think most document formats do), so you can literally define a square of 5x5cm in the document for example.
- user2342 3y ago"Please don’t try to print it." :-)
- lovegrenoble 3y agoHow many viruses it could contain )
- moritzwarhier 3y agoThis is mentioned prominently in the German Wikipedia article about the PDF format. Was wondering if this needs a (200x). Sad to see the article quote some random Xitter post as "source".