Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pdfoid/backends/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import base64
from contextlib import closing

from selenium.webdriver.chrome.service import Service
from tornado import gen
from tornado.process import Subprocess

from pdfoid.utils import utf8bytes, utf8text

Expand Down Expand Up @@ -78,11 +78,12 @@ def get_log(self, driver):

@gen.coroutine
def html_to_pdf(self, *, header_template, footer_template, wait_for):
service = Service(executable_path=self.backend.chromedriver_path)
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.binary_location = self.backend.chrome_path

browser = webdriver.Chrome(self.backend.chromedriver_path, options=options)
browser = webdriver.Chrome(service=service, options=options)
with closing(browser):
browser.get('file://%s' % self.input_html_file)

Expand Down