"it seems that I need to start recording before the draw function even runs to capture the results"
Exactly. Or, more accurately, you need to record before starting the drawing operations that must be recorded.
"recorded" is the keyword, here: the PDF doesn't save a state of the drawing, like save() does, it records the drawing orders to be able to replay them.
So you need to always record the drawings even if you finally discard them.
Exactly. Or, more accurately, you need to record before starting the drawing operations that must be recorded.
"recorded" is the keyword, here: the PDF doesn't save a state of the drawing, like save() does, it records the drawing orders to be able to replay them.
So you need to always record the drawings even if you finally discard them.