pdfpdf-generation

Smallest possible invisible PDF?


This question is related to What is the smallest possible valid PDF?, but goes one step further: I'd like a PDF file that is as small as possible, but also invisible.

That means:

When I open this file in a compliant PDF viewer, the background color of the viewer panel should show through completely, and when I embed it in a document on top of other elements, only these other elements should show.


Solution

  • PDF pages have no background color by default (if you need an explicit background you have to draw a colored rectangle that covers the entire page).
    PDF viewers will use a default white background to simulate a paper page, so the actual background depends on the PDF viewer.
    When you place a PDF page on top of another one it will not block the underlying content if it does not have an explicit background.