On exactitude in PDFs


Obviously it’s a semi-silly question, because even though the MediaBox has a limited size in points, the underlying image model lets you apply an affine transformation to describe geometry much, much larger than that.

E.g. you can scale up by 1038, move the x origin to 1038 units, start a line at +1038 units, translate to -1038, and finish the line at -1038 units. So a PDF can totally describe a line 14 billion trillion trillion trillion trillion trillion kilometers long; it just won’t necessarily fit on the stated page size.

However, at that scale the end points of your line are only accurate to the nearest 35 billion trillion kilometers (assuming 32-bit floats). To print at a resolution better than 1 dot per galaxy cluster, you’d have to limit yourself to somewhat smaller scales.

If you assume your PDF needs at least 300dpi, then you can still scale up by a factor of 2 million, and draw a line 4*1038 units long as before. So I would say that if you want good-quality prints, you should limit yourself to artwork no more than 280 trillion trillion trillion kilometers across. That’s a bit smaller than an A-137 sheet of paper.


24 bit mantissa assuming it follows from postscript

Most implementations of PostScript use single-precision reals (24-bit mantissa), so it is not meaningful to use more than 9 decimal digits to specify a real number, and performing calculations may produce unacceptable round-off errors

1 Like

a lot has happened since 1997.

The PDF-1.7 standard says

PDF provides two types of numeric objects: integer and real. Integer objects represent mathematical integers within a certain interval centered at 0. Real objects approximate mathematical real numbers, but with limited range and precision; they are typically represented in fixed-point form rather than floating-point form. The range and precision of numbers are limited by the internal representations used in the computer on which the PDF consumer application is running; Appendix C gives these limits for typical implementations.

Appendix C says that Adobe Acrobat uses single Precison numbers.

However, PDF-1.7 has been replaced by PDF-2.0, (and although this standard is technically free, the publisher still wants credit card info)

Moreover Alex uses Preview instead of the Acrobat application, so Apple’s implementaion might well understand double precision numbers,

1 Like

That’s definitely true – PostScript implementations, including Illustrator(?*), do use a lot of fixed-point numbers and are limited to quite small artwork, to the point that it’s sometimes still an issue. But PostScript code doesn’t store numbers in binary form (I believe the language predates IEEE floating point formats), and is just plain text, so even in 1985 you could write

/longline {
		2000000 dup scale
		100000000000000000000000000000000000000 dup
		dup 0 translate
		dup 0 moveto
	    -1 * dup 0 translate
		0 lineto
} def
longline stroke

– which won’t be a problem if the interpreter stores numbers as floats in memory. I’m guessing that’s what any modern interpreter does, because that’s the simplest way to do it on any modern CPU.

But I also don’t suppose anyone uses doubles, because that uses twice as much memory, and by definition even a single-precision float should be more than enough, since these files are still supposed to work on a LaserWriter.


At one time I had a laserwriter II hooked up to my mac-osx machine. Mac OSX spoke Postscript level two, so I had to use a driver to translate it back to postscript level one. I’m going to have to turn in my nerd card now, becase I junked it. Between the need to bridge Appletalk to ethernet, the power consumption, the ozone filter, and the postscript level conversion, it just wasn’t worth keeping around.

When it worked, it was beautiful. When it didn’t, it was a heavy, bulky white elephant.


Pretty sure I saw this video on the BoingBoings.

So now we know the paper size settings for “Planck Length” (A226) and "Observable Universe (A-184)


My wife was instructed to take a photo with her phone for her passport renewal photo, and when I read the instructions that gave dimensions in inches for said photo something inside me screamed.

1 Like

His scripts are written as if they were poetry.


This topic was automatically closed after 5 days. New replies are no longer allowed.