jipp icon indicating copy to clipboard operation
jipp copied to clipboard

q and Q operators are unbalanced

Open 914802951 opened this issue 2 years ago • 0 comments

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.

914802951 avatar Apr 22 '22 08:04 914802951