-
I'm think I'm missing something subtle in how Python works. I'm trying to set a line dash pattern inside a local context. I know I can simply use set_dash_pattern as a stand alone instruction inside the local_context but the docs for local_context also provides a pass parameter dash_pattern and I'd like to use that to define my line attributes when starting the local context. Something like:
I get:
I've tried various syntax to correct the error but I'm missing how to fix this. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I needed to understand Python mappings better. Here's the correct syntax:
|
Beta Was this translation helpful? Give feedback.
I needed to understand Python mappings better. Here's the correct syntax:
with myPDF.local_context(draw_color=(colors[6].r,colors[6].g,colors[6].b), stroke_opacity=colors[6].opacity, line_width=2.5, dash_pattern={'dash':2,'gap':2})