Style changing commands #1520
-
Hi @JorjMcKie, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Happy New Year to you too! You are right: In PyMuPDF, class |
Beta Was this translation helpful? Give feedback.
Happy New Year to you too!
You are right:
"q"
and"Q"
are defined as the stacking commands for the "graphics state". Any graphics setting made within their scope is reset to the corresponding value preceeding the"q"
.Which PDF commands these are (it's not all of them) is best looked up in the PDF manual, page 125+.
In PyMuPDF, class
Shape
controls this: The.finish()
method takes care of this wrapping. Any draw command preceeding it will be put under the effect of the parameters given tofinish()
.If you instead use the same-named
Page
methods, likepage.draw_rect()
, then the corresponding shape method is invoked - plus using the extra parameters, afinish()
and acommit()
will be execut…