As mentioned in https://github.com/graphcool/chromeless/pull/84#issuecomment-319739604, the error "PrintToPDF is not implemented" gets raised when trying to use the .pdf() method.
Everything worked fine when this feature was first implemented. It's possible that something else got merged into master in the past few days that's incompatible with the PDF feature (#84).
My best guess is that there's some incompatibility with chrome-launcher (#120).
Is the Chrome that chrome-launcher is launching the same version as what you were launching manually before? Have you tried running the browser first, and then trying to run .pdf() ?
edit: never mind. I have same issue using latest Canary.
Ah, you're right. When I run the headless browser first, it works fine.
According to the README:
By default, chromeless will start Chrome automatically and will default to the most recent version found on your system if there's multiple.
Is it possible that this isn't working correctly? I have Chrome 60 installed on my system, but the PDF feature isn't working unless I start chrome manually.
Closing this issue since the issue appears to be related to my system, not the library itself.
Weird. Same behaviour here. In non-headless mode I get the PrintToPDF is not implemented error. In headless mode it works fine. Maybe an issue in Chrome itself鈥擮r, it's possible this API is not available in non-headless mode. Unless someone beats me to it, I'll ask about it on headless-dev (please someone beat me to it 馃槈 ).
[--disable-extensions]
is possibly active when chrome-launcher runs the headless chrome, pretty much disabling the PDF capability of Chrome.
That's why when being run with "heady" Chrome it runs
I've tried running my chrome using this command
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --disable-translate --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --no-first-run --remote-debugging-port=9222 --user-data-dir=/var/folders/n6/h3prs0p54db03sv1rms8klv40000gp/T/lighthouse.XXXXXXX.2S5cFhwC about:blank
And it seems it still can't pick up the PDF extension to do PrintToPDF command
I have managed to get it working lauinching Chrome with the --disable-extensions options
chrome --remote-debugging-port=9222 --disable-gpu --headless --disable-extensions