Making a PDF that's larger than Germany
alexwlchan.net
alexwlchan.net
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.nytimes.com/2009/07/18/technology/companies/18am...
Radars would show up with PDFs attached, "Preview Does Not Display 3D Image in PDF Like Acrobat" or similar. And I would feel so ... inadequate.
PDFKit could render and capture basic annotations ... and that was about it. We could show you forms, allow editing, but if the PDF had Javascript that would add two fields and put the sum in a third field I had to shrug and say, "Oh well." The effort of hoisting a JavaScript interpreter/runtime was beyond my skillset anyway.
But then I kind of came to see our subset of PDF support as a kind of feature. It's true, we left out the kitchen sink. Adobe was/is clearly interested in putting everything into PDF.
And I mean, as pointed out here, at least you could open a PDF in Preview and not worry about any Javascript executing. ;-)
For all of the PDFs I've ever encountered, Preview has been sufficient and capable. Thank you for your hard work!
I met one of the engineers from Adobe and said as much — as politely as I could. He said, yeah, we're modeling our UI on Office.
I saw in an instant that they wanted to be seen as a peer, a co-tool, to the Microsoft suite and it all made sense to me.
Seconded. At least most pleasant to use for most things, and never balked at anything I needed to see, fortunately.
Adobe has an awful track record of security (how many exploits in the past 25 years were in Acrobat (not the PDF spec, the actual Acrobat software) and in Flash?) but PDF is an amazing gift to the world, and, thanks to people like you, effectively safer than how Adobe designed it :))
Unfortunately I have the full Acrobat on my work computer, mandated by my employer, sigh, but that's another story.
Formats are on a gradient between "completely code" and "completely data" and PDFs are quite close to the "completely code" extreme'; I guess this is what the parent meant.
And row hammer, to breach the sandbox.
While that may technically be "escaping the sandbox" it's a different case, because it was never meant to work, will be fixed and often is fixed.
Sure if the PDF standard exposed a "globalThis.runBlobAsNativeExecutable" function it would be worse, but it is still escaping the sandbox.
It is worth noting that Chromium and later Firefox both added PDF viewers that live inside the browser sandbox. They are essentially web-apps that render the PDF. When I worked at Google they strongly recommended using Chrome for opening PDF files because they felt much more comfortable about its security and sandboxing than other PDF readers.
On another perspective is that you are likely browsing the internet anyways. In fact you likely got the PDF by visiting a website. So you have already exposed a huge attack surface (your browser) to a possible hostile adversary. It is better to expose them to the same attack surface again (plus whatever security the PDF reader itself provides) than to give them a fresh new attack surface.
and maybe I'm wrong but the only way to convert arbitrary pdf to pdf/a with open source software is to convert it to postscript and back with ghostscript - which is affero licensed... with all the possible problems it entails. (there is old version that is just gpl, works on most pdfs but is 15 years old or such.)
i needed to deal with pdf/a in a previous job... was not fun.
And what problems are those? Besides making it harder to leech off the community without giving back of course.
I will never forgive the pain PDF caused me when I worked on a project to parse millions of PDF files from various sources. Just reconstructing paragraphs was a huge effort not even mentioning parsing tables. I think we should do better for something that’s basically a standard. PDF manuals also suck big time.
(I've always had to keep my love of PDF a secret from fellow nerds. But here's another secret, I like printing documents out from time to time.)
And it can't be LaTeX, because the document shouldn't be a programming language at all. "The document is a program" has proven itself to be a terrible scheme overall.
It can reflow but tries to paginate HTML ... the way printing a web page tries to paginate HTML, ha ha.
As someone working in the graphic industry, I'd say PDF/X is the true PDF, but ymmv. :-)
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.
https://s3.amazonaws.com/arena-attachments/881694/cb6119367b...
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
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
>>And thanks for the text example! This looks like what I was trying, but clearly I had a mistake somewhere.
So CR/LF, space/LF, and space/CR are all valid endings.
> The byte offset in the decoded stream shall be a 10-digit number, padded with leading zeros if necessary, giving the number of bytes from the beginning of the file to the beginning of the object. It shall be separated from the generation number by a single SPACE. The generation number shall be a 5-digit number, also padded with leading zeros if necessary. Following the generation number shall be a single SPACE, the keyword n, and a 2-character end-of-line sequence consisting of one of the following: SP CR, SP LF, or CR LF. Thus, the overall length of the entry shall always be exactly 20 bytes
This is interesting. Never actually saw anything other than CRLF in practice, even inside of PDF files that otherwise were LF-only.
[1]: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandard... page 41
Can you help me count zeroes? Why is it million and not billion?
15 billion inches are 381,000km. The original claim is the limit is 15 million inches.
How will I know if I can fold it more than 7 times, though?
“I have a map of the United States. It’s actual size. “
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?
You can switch between the modes by clicking a compass icon
Do you mean where the top edge of the phone is directed towards when I hold the phone so that its display is pointing towards the sky?
Or where the backside of the phone is directed at if I hold it upright in front of my face?
Does that really happen? I have never experienced it. How do they tell which way is north?
Highway 101 runs through San Jose pretty much due east/west, but because it also runs up to San Francisco, it is officially a north-south highway. So you check your position on the map and you're traveling due east along an east/west road. Is that "north"? (Of course not. It's "south".)
For navigation?
1. Don't activate navigation. It's broken six ways to Sunday, and burns through battery like there's no tomorrow. Use route preview instead (i.e. the step after searching, but before activating the voice nav proper).
2. Use your fingers to rotate the map so it always faces the same way you're going.
3. If confused, recenter and press the compass so it rotates to have North at the top, and continue from there.
Now FWIW, I use Google Maps when navigating on foot/scooter, or as a pilot in the car. If I were a driver... I'd probably buy TomTom or whatever nav that's not shit.
https://s3.amazonaws.com/arena-attachments/881694/cb6119367b...
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.
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.
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.
> Please don’t try to print it.
my first reaction has been: you are not my mom. >:-)
[1] https://developer.adobe.com/document-services/docs/assets/5b...
not every time one can see a whole game integrated into a PDF!
Because I would literally spend days worth of time scrolling.
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.
If you're talking about embedded active content within them, then a reader application can just ignore/not run it.
If you're talking about a crafted PDF that exploits, let's say, font rendering bugs inside the reader than it's near impossible. Keep your applications updated.
On Android, for example, there is the GrapheneOS Pdf Viewer [1]. It's readme has a pretty good explanation of how it works.
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
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.
". . . 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."
"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." 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!”https://s3.amazonaws.com/arena-attachments/881694/cb6119367b...
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
Sad to see the article quote some random Xitter post as "source".
Funny document, still
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.
Also, PDF preview in Chrome simply showing it like a normal PDF, but Preview seems confused (gray background instead of white)?
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.
Obligatory?: The pdf is not the territory.
--Ian Malcolm in the original Jurassic Park film
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.