ドイツより大きなPDFを作る

The Maximum Size of a PDF: Fact or Fiction?

Have you ever come across the claim that there is a maximum size for a PDF document? It seems that this notion has been circulating on the internet for quite some time now. The claim states that the maximum size for a PDF is 381 km × 381 km, which is about half the area of Germany. But is this claim based on facts or is it just a myth?

Upon seeing this claim once again on social media, I couldn’t help but wonder if anyone has actually created a PDF of such immense size. I decided to delve into the internals of PDF and explore its limitations.

Many people who refute this claim often point out that it is a limitation of a specific PDF reader app, rather than a limitation of the PDF format itself. They usually refer to the Wikipedia article on PDF, which states that Adobe Acrobat imposes a limit of 15 million by 15 million inches, or 225 trillion in2 (145,161 km2).

Further investigation led me to the PDF 1.7 specification, where I discovered that the maximum page dimension is determined by the UserUnit entry in the page dictionary. In Acrobat 7.0, the maximum UserUnit value is 75,000, which results in a maximum page dimension of 15,000,000 inches (381 km).

Armed with this knowledge, I decided to experiment and create PDFs that exceeded these so-called “maximum” values. Although I had never delved into the internals of a PDF document before, I found an informative article that explained its internal structure. With a little help from ChatGPT and some trial and error, I was able to manually write simple PDF files.

My understanding of PDF structure is as follows: a PDF file begins with a version number and an end-of-file marker. It then contains a list of objects, each representing various elements found in the PDF, such as pages, text, and graphics. Following the objects is the cross-reference table, which serves as a lookup table for all the objects in the file. The trailer section contains metadata about the document, and the startxref value points to the start of the cross-reference table.

With this newfound ability to edit PDFs by hand, I set out to create monstrously large ones. The size of each page in a PDF is specified in the individual “Page” objects, which allows for different page sizes. By adjusting the MediaBox value, I was able to increase the page size. Additionally, by modifying the UserUnit value, I could increase the unit size and consequently the page dimensions.

Using these techniques, I was able to create a PDF with a page size of 381 km × 381 km, matching the original claim. However, it is important to note that this limit is specific to Adobe Acrobat, and other PDF readers may not support such large page sizes. In fact, the default macOS Preview app completely ignores the UserUnit value and treats all PDFs as if the unit size is 1/72 inch.

While it is intriguing to explore the boundaries of PDF size, it’s worth mentioning that creating extremely large PDFs may not be practical or useful in most scenarios. The majority of PDFs are intended for everyday use and do not require such immense dimensions.

In conclusion, the claim that there is a maximum size for a PDF document is not entirely accurate. While there are limitations imposed by certain PDF reader apps, the PDF format itself does not have a fixed maximum size. By understanding the internal structure of PDFs and manipulating their objects, it is possible to create PDFs that exceed these supposed limits. However, it is important to consider the practicality and compatibility of such large PDFs in real-world scenarios.

So, the next time you come across claims about the limitations of PDFs, take a closer look and consider the context. It’s always fascinating to explore the boundaries of technology, but it’s equally important to understand the practical implications and real-world usage of such endeavors.

By Alex Chan

Thank you for reading!

注意

  • この記事はAI(gpt-3.5-turbo)によって自動生成されたものです。
  • この記事はHackerNewsに掲載された下記の記事を元に作成されています。
    Making a PDF that’s larger than Germany
  • 自動生成された記事の内容に問題があると思われる場合にはコメント欄にてご連絡ください。

コメントする