Skip to content

q and Q operators are unbalanced #121

@914802951

Description

@914802951

From section 8.4.2 of PDF 32000-1:2008

  • The q operator shall push a copy of the entire graphics state onto the stack.
  • The Q operator shall restore the entire graphics state to its former value by popping it from the stack.

Occurrences of the q and Q operators shall be balanced within a given content stream (or within the sequence
of streams specified in a page dictionary’s Contents array).

The PCLm obtained using PclmWriter is as follows:

4 0 obj
<<
/Length 25321
>>
stream
0.12 0 0 0.12 0 0 cm
/P <</MCID 0>> BDC q
4961 0 0 16 0 7000 cm
/Image0 Do Q
/P <</MCID 0>> BDC q

...data...

4961 0 0 8 0 0 cm
/Image438 Do Q
/P <</MCID 0>> BDC q

endstream
endobj

This is treated as an error on some serious printers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions