File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class PDFKit(object):
19
19
:param options: dict (optional) with wkhtmltopdf options, with or w/o '--'
20
20
:param toc: dict (optional) - toc-specific wkhtmltopdf options, with or w/o '--'
21
21
:param cover: str (optional) - url/filename with a cover html page
22
- :param css: str (optional) - path to css file which will be added to input string
22
+ :param css: str (optional) - path to css file which will be added to input string or a list with multiple paths
23
23
:param configuration: (optional) instance of pdfkit.configuration.Configuration()
24
24
"""
25
25
@@ -161,8 +161,14 @@ def _prepend_css(self, path):
161
161
raise self .ImproperSourceError ('CSS file can be added only to a single '
162
162
'file or string' )
163
163
164
- with open (path ) as f :
165
- css_data = f .read ()
164
+ if not hasattr (path , "__iter__" ):
165
+ path = [path ]
166
+
167
+ css_data = ""
168
+ for p in path :
169
+ with open (p ) as f :
170
+ css_data += f .read ()
171
+ css_data += "\n "
166
172
167
173
if self .source .isFile ():
168
174
with open (self .source .to_s ()) as f :
You can’t perform that action at this time.
0 commit comments