alafr / SVG-to-PDFKit

Insert SVG into a PDF document created with PDFKit
MIT License
402 stars 114 forks source link

fix of svg pattern filling on pdfkit/pdfmake at minified version #159

Closed rafaeelneto closed 2 years ago

rafaeelneto commented 2 years ago

the problem

The svg pattern filling isn't correctly draw when a pdf is created at production. The problem seems to be related to the if statement on docFillColor and docFillColor functions. The color parameter, when in production, has a different strutucture. The problem is reported at pdfMake/issue#1832

before

the conditional statement on docFillColor and docFillColor functions is currently like

if (color[0].constructor.name === 'PDFPattern')

after

i`ve added another condition to both if statements

if (color[0].constructor.name === 'PDFPattern' || color[0].dx)

alafr commented 2 years ago

Close #159 as the issue #137 is fixed more cleanly with PR #168