this post was submitted on 01 Feb 2024
262 points (93.1% liked)

Technology

59414 readers
3554 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

Some version of this has been floating around the Internet since 2007, probably earlier. This tweet is pretty emblematic of posts about this claim: it’s stated as pure fact, with no supporting evidence or explanation. We’re meant to just accept that a single PDF can only cover about half the area of Germany, and we’re not given any reason why 381 kilometres is the magic limit.

I started wondering: has anybody made a PDF this big? How hard would it be? Can you make a PDF that’s even bigger?

A few years ago I did some silly noodling into PostScript, the precursor to PDF, and it was a lot of fun. I’ve never actually dived into the internals of PDF, and this seems like a good opportunity.

Let’s dig in.

top 29 comments
sorted by: hot top controversial new old
[–] aeronmelon@lemmy.world 91 points 9 months ago (2 children)

How do we know we're not living inside a PDF right now?

[–] kurcatovium@lemm.ee 26 points 9 months ago

How could we possibly live in PDF when we're obviously living in Excel table?

[–] agamemnonymous@sh.itjust.works 4 points 9 months ago

It's always been Wankershim

[–] General_Effort@lemmy.world 85 points 9 months ago (3 children)

Arrows pointing out from Germany indicating a pointless quest for more space. Why do I feel like I have seen that before?

[–] eggymachus@sh.itjust.works 62 points 9 months ago* (last edited 9 months ago) (1 children)
[–] victorz@lemmy.world 9 points 9 months ago

Bravo. 👏⛳

[–] xavier666@lemm.ee 5 points 9 months ago (1 children)
[–] assassinatedbyCIA@lemmy.world 2 points 9 months ago

The writers are getting lazy

[–] Buddahriffic@lemmy.world 2 points 9 months ago

I'm not sure what you're referring to. Augustus' legion might have painted a map like that but they were trying to escape their quest for more space and didn't really have the time to make any maps about it what with all of the arrow and axe dodging they needed to do.

[–] RememberTheApollo@lemmy.world 66 points 9 months ago

I could keep going. And I did. Eventually I ended up with a PDF that Preview claimed is larger than the entire universe – approximately 37 trillion light years square. Admittedly it’s mostly empty space, but so is the universe.

So yes. It can be done.

[–] NeatNit@discuss.tchncs.de 53 points 9 months ago (1 children)

The takeaway is that the format doesn't have any limit, but Adobe Acrobat in particular implements an arbitrary cutoff size. Other readers, such as Firefox's built-in PDF reader or Mac's Preview, can handle any arbitrary size. The article ends with a PDF the size of the universe, weighing an unimaginable 549 bytes!

But that limitlessness can come at a cost: according to the article, Preview doesn't handle UserUnit which should affect page size, while Acrobat (and Firefox) do. I'm guessing (gut feeling) Acrobat probably supports the most features overall, Firefox probably supports the vast majority of those used in practice, and Preview only allows Apple Approved™ PDF features and extensions deemed worthy of Their Appleness's consideration. Chrome's PDF reader is probably on the same level as Firefox, I guess.

[–] abhibeckert@lemmy.world 14 points 9 months ago* (last edited 9 months ago) (1 children)

I’m guessing (gut feeling) Acrobat probably supports the most features overall, Firefox probably supports the vast majority of those used in practice, and Preview only allows Apple Approved™ PDF features and extensions deemed worthy of Their Appleness’s consideration.

OK... stepping out of gut feelings into reality:

  • Adobe originally had a maximum page size of 45 inches square.
  • In 2001 they increased that to 200 inches
  • And in 2004 Adobe increased it to 15,000,000 inches (a bit larger than Germany) which is still kinda sucky if you want to show a map on a PDF

As for "Their Appleness's consideration" they generally use floating point numbers for coordinates and sizes. Which is how, as it says in the OP's article, it's able to handle a PDF trillions of light years in size. A double precision floating point number can be really big.

More important though, it means you can process it with hardware accelerated floating point operations which are incredibly fast. And Apple's PDF renderer needed to be fast because for years PDF was the data format used by the window manager for pretty much all screen drawing operations. They weren't doing that on modern fast hardware either, they were doing it decades ago on slow hardware. With decent performance.

If there are features missing it's probably because they would slow things down too much.

[–] NeatNit@discuss.tchncs.de 5 points 9 months ago* (last edited 9 months ago)
  • Adobe originally had a maximum page size of 45 inches square.
  • In 2001 they increased that to 200 inches
  • And in 2004 Adobe increased it to 15,000,000 inches (a bit larger than Germany) which is still kinda sucky if you want to show a map on a PDF

It's unclear why Acrobat has to have a limitation at all, since other PDF programs have no such limitation. More importantly, Acrobat only supports up to 200.00 x 200.00 in (5.08 x 5.08 m) using the standard MediaBox setting - any higher than that and you get a warning. The only way to push past that is to also set a UserUnit value, which essentially acts as a multiplier. This is all detailed in the article.

But Apple's Preview doesn't support UserUnit, meaning a PDF larger than 200 x 200 in can't be displayed correctly in both Acrobat and Preview. If you set it higher using just MediaBox, then Preview will show it fine but Acrobat will truncate it. If you set MediaBox to the highest values Acrobat accepts and use UserUnit as a multiplier, then Acrobat will show it fine but Preview would not (I don't know if it would truncate it or show it scaled down). So when it comes to PDFs larger than 200 x 200 in, you can choose either up to 15,000,000.00 x 15,000,000.00 in in Acrobat or as large as you like in Preview - you can't have both.

As for “Their Appleness’s consideration” they generally use floating point numbers for coordinates and sizes. Which is how, as it says in the OP’s article, it’s able to handle a PDF trillions of light years in size. A double precision floating point number can be really big.

More important though, it means you can process it with hardware accelerated floating point operations which are incredibly fast. And Apple’s PDF renderer needed to be fast because for years PDF was the data format used by the window manager for pretty much all screen drawing operations. They weren’t doing that on modern fast hardware either, they were doing it decades ago on slow hardware. With decent performance.

If there are features missing it’s probably because they would slow things down too much.

All interesting and some things I didn't know, but this is completely irrelevant. A PDF-reading app (i.e. Preview) does not have to use, and almost certainly does not use the same PDF rendering engine as the desktop rendering one you described. An obvious relevant example is pages - the desktop renderer doesn't need to know about or render pages at any point. It doesn't deal with the size of a page, the existence of multiple pages, or pages of different sizes. It has only one canvas to draw in. A PDF viewer app OTOH obviously has to be able to handle all of these things, and render them into a format that can be pushed to the system's graphics API.

See this StackExchange answer, which quotes this paragraph from Ars Technica (emphasis mine):

it is important to understand that Core Graphics Services deals with more or less "ready-to-display" data sent to it from higher layers in the graphics system. It is a pixel pusher, not a graphics creator

It doesn't deal with any features, whereas a reader app must deal with many features. So discussing it is irrelevant for the Preview app.

Edit: and I was only poking fun at Apple's policies in general. Their current crusade against anything that isn't 100% under their totalitarian control on iOS in Europe is most telling. I think in this case the only reason they don't support UserUnit is that it's basically never used in practice and they never realized it's missing.

[–] Gork@lemm.ee 49 points 9 months ago (1 children)

Clearly PDF is an outdated standard if it cannot handle files greater than 381 km x 381 km in size.

[–] NeatNit@discuss.tchncs.de 11 points 9 months ago (1 children)

For real! How am I going to make a 1:1 map of Europe like this?!

[–] SirQuackTheDuck@lemmy.world 6 points 9 months ago

There's probably an emacs plugin for that.

[–] Diplomjodler@feddit.de 32 points 9 months ago (1 children)

Eventually I ended up with a PDF that Preview claimed is larger than the entire universe

Printer's out of toner. Can you fax it to me?

[–] xavier666@lemm.ee 1 points 9 months ago

Printer out of cyan ink

[–] far_university1990@feddit.de 17 points 9 months ago

𝕯𝖎𝖊𝖘𝖊 𝕶𝖔𝖒𝖒𝖊𝖓𝖙𝖆𝖗𝖘𝖊𝖐𝖙𝖎𝖔𝖓 𝖎𝖘𝖙 𝖓𝖚𝖓 𝕰𝖎𝖌𝖊𝖓𝖙𝖚𝖒 𝖉𝖊𝖗 𝕭𝖚𝖓𝖉𝖊𝖘𝖗𝖊𝖕𝖚𝖇𝖑𝖎𝖐 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉

[–] visnae@lemmy.world 16 points 9 months ago* (last edited 9 months ago) (1 children)

Fun fact, LaTeX is actually ~~NP~~turing-complete so you can program whatever in it AND make it beautiful

[–] user134450@feddit.de 9 points 9 months ago (1 children)
[–] visnae@lemmy.world 1 points 9 months ago

Yes sorry ofc

[–] DirigibleProtein@aussie.zone 14 points 9 months ago (1 children)

How can my manager print seven copies?

[–] SoylentBlake@lemm.ee 4 points 9 months ago

Fax it to him 😉

[–] HootinNHollerin@lemmy.world 14 points 9 months ago

Stop! You’re making HP’s ink boner larger than Silicon Valley!

[–] uriel238@lemmy.blahaj.zone 12 points 9 months ago (1 children)

Isn't PDF vector (with pixel drop-in elements)? Those should be scaleable to the word size (e.g. 128 bit) But the problem with these like some open world games is a lot of empty space with few exciting features.

1200DPI the size of Germany, or even enough text to fill Germany with 12 point fot would be impressive.

[–] NeatNit@discuss.tchncs.de 4 points 9 months ago (1 children)
[–] trolololol@lemmy.world 1 points 9 months ago

It's a niche hobby now, but next year we'll be a dozen of us! Wait and see! Buahaha

[–] TheRealKuni@lemmy.world 1 points 9 months ago

This is delightful.