From 7781c1887eabf09ef334536ee9a7b1829f226498 Mon Sep 17 00:00:00 2001 From: Mika Date: Tue, 9 Feb 2021 15:56:12 +0200 Subject: [PATCH] fixed issue 4 --- pdfy/pdfy.py | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdfy/pdfy.py b/pdfy/pdfy.py index d087ea6..66c021a 100644 --- a/pdfy/pdfy.py +++ b/pdfy/pdfy.py @@ -55,7 +55,7 @@ def __path_to_url(self, path): def html_to_pdf(self, html_path, pdf_path = None, options={"paperWidth": 8.3, "paperHeight":11.7, "marginTop": 0, "marginBottom":0, "marginLeft":0, "marginRight":0}): self.chrome.Page.navigate(url=self.__resolve_path(html_path)) self.chrome.wait_event("Page.frameStoppedLoading", timeout=60) - pdf_data = self.chrome.Page.printToPDF(**options)["result"]["data"] + pdf_data = self.chrome.Page.printToPDF(**options)[0]["result"]["data"] if pdf_path is None: return pdf_data else: diff --git a/setup.py b/setup.py index 1ed1337..8c5b814 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="pdfy", - version="1.0.50", + version="1.1.0", author="Mika Hämäläinen", author_email="mika@rootroo.com", description="A library for converting HTML files into PDF. The tool uses Chrome to render the HTML and print it into a pdf file.", @@ -16,7 +16,7 @@ packages=setuptools.find_packages(), install_requires=[ 'selenium', - "PyChromeDevTools" + "PyChromeDevTools>=0.3" ], classifiers=( "Programming Language :: Python :: 3",