-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to send html instead of url? #22
Comments
FYI - did a little digging and found that the underlying library accepts data urls, so if you take your html, base64 encode it and then request pdf-bot with a url of |
Hi, I tried to convert local file using $ pdf-bot push 'file://full/path/contract.html'
The job was created with ID 82a0112d-7eaa-474a-8b4c-d13ee6a8ec4a
$ pdf-bot shift:all
Found 1 jobs, divided into 1 chunks
Running chunk 1, 0 chunks left
html-pdf-chrome error: Error: HtmlPdf.create() page navigate failed. (job ID: 82a0112d-7eaa-474a-8b4c-d13ee6a8ec4a. Generation ID: 746d2054-267e-4e85-ab46-19d900b5b20c) As you see above it generates error.
|
I reply for myself - it is possible, but required some quirk in the following line: Line 2 in a2edd1e
Should be: var isValidUrl = function (url) {
return url.match(/(((file:\/|[A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/)
} because for |
Hi,
Thanks for the wonderful library and all the effort that you invested. I have a situation where I'd prefer to send raw html to the bot and get back pdf in return, so no urls just html in POST request, is that possible? Thanks.
The text was updated successfully, but these errors were encountered: