ilaborie / html2pdf

Just a CLI over the headless_chrome https://crates.io/crates/headless_chrome crate to render a PDF from a local HTML file
Apache License 2.0
30 stars 12 forks source link

Incorrect path on Windows for input #5

Closed dburriss closed 2 years ago

dburriss commented 2 years ago

First off, thank you for this crate. I am new to Rust and saw some different patterns to what I was using in my CLI I have been writing. Not only that but your thoughtful use of info and debug console writing allowed me to diagnose the issue.

I tried installing the binary on Windows and using it and I received the following error:

Error: HeadlessChromeError("Method call error -32000: Cannot navigate to invalid URL")

Looking at the console output the input file seemed a bit weird:

INFO html2pdf > Input file: file://\?\C:\Users\devon\GitHub\cv\index.html

It seems that using that with the "file://" for headless_chrome is not valid, at least headless_chrome doesn't see it that way.

dburriss commented 2 years ago

I have a fix for this. Hopefully, you accept PRs?

dburriss commented 2 years ago

Pulled latest from cargo and works on Windows. Closing.