michaelrsweet / pdfio

PDFio is a simple C library for reading and writing PDF files.
https://www.msweet.org/pdfio
Apache License 2.0
198 stars 44 forks source link

allow pdfioContentSetDashPattern to omit on/off values in output #41

Closed zacii7 closed 1 year ago

zacii7 commented 1 year ago

I don't see any way to restore the dash pattern to draw a solid line

based on the pdf reference, [] 0 d can be used to set the dash pattern to a solid unbroken line [3] 0 d sets dash pattern to alternating 3 on, 3 off, ...

but the function pdfioContentSetDashPattern always outputs both on and off parameters in the dash array, making these examples impossible to specify.

one suggestion might be, since 0 is anyway a useless value for the on/off parameter, to ignore 0 values when generating pdf output.

michaelrsweet commented 1 year ago

Usually you save/restore the graphics state when making this sort of change, but I can look at extending the API to allow for clearing the dash pattern.

michaelrsweet commented 1 year ago

[master 19c4587] Update pdfioContentSetDashPattern to support setting solid line styles (Issue #41)