Skip to content

Commit 5b81171

Browse files
committed
pdfkit/pdfkit: Keeping the options order for python < 3.6
Options mixup may result in wkhtmltopdf failing example: OSError: wkhtmltopdf exited with non-zero code 1. error: --margin-bottom specified in incorrect location
1 parent a1ba6bf commit 5b81171

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdfkit/pdfkit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import re
33
import subprocess
44
import sys
5+
from collections import OrderedDict
56
from .source import Source
67
from .configuration import Configuration
78
import io
@@ -46,7 +47,7 @@ def __init__(self, url_or_file, type_, options=None, toc=None, cover=None,
4647
except AttributeError:
4748
self.wkhtmltopdf = self.configuration.wkhtmltopdf
4849

49-
self.options = dict()
50+
self.options = OrderedDict()
5051
if self.source.isString():
5152
self.options.update(self._find_options_in_meta(url_or_file))
5253

0 commit comments

Comments
 (0)