HPInc / jipp

A Java-compatible implementation of IPP
MIT License
153 stars 42 forks source link

q and Q operators are unbalanced #121

Open 914802951 opened 2 years ago

914802951 commented 2 years ago

From section 8.4.2 of PDF 32000-1:2008

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.