Search code examples
pdfpdf-generation

Can a name object be an indirect reference in a PDF file?


According to the PDF 1.7 (ISO32000-1:2008) specification, a PDF file is composed of eight basic types of objects: Boolean values, Integer and Real numbers, Strings, Names, Arrays, Dictionaries, Streams, and the null object.

Additionally, an object can be labeled and referenced as an indirect object. In the specification, they give the following example:

7 0 obj
    << /Length 8 0 R >>    % An indirect reference to object 8
stream
    BT
        /F1 12 Tf
        72 712 Td
        ( A stream with an indirect length ) Tj
    ET
endstream
endobj

8 0 obj
    77                     % The length of the preceding stream
endobj

Of course, this is an obvious example, the PDF dictionary object is composed of a Name (Key) and a value, which can be an indirect reference. What I'm wondering is if the name itself can be an indirect reference, for example:

1 0 obj
    /Length
endobj

2 0 obj
    << 1 0 R 77 >>
...
endobj

In this case, the name itself is an indirect reference.


Solution

  • For pdf dictionary objects the keys are always direct pdf name objects.