Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

q and Q operators are unbalanced #121

Open
914802951 opened this issue Apr 22, 2022 · 0 comments
Open

q and Q operators are unbalanced #121

914802951 opened this issue Apr 22, 2022 · 0 comments

Comments

@914802951
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant