-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature - accept content to render pdf by url #5
base: main
Are you sure you want to change the base?
Feature - accept content to render pdf by url #5
Conversation
Add ability to pass in the url argument to weasyprint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the documentation to identify and describe the new functionality. It would be nice if you could add an additional working example like the existing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running curl -v -X POST -H 'Content-Type: text/plain' -d 'https://www.google.ca/?client=safari&channel=iphone_bm' -JLO http://127.0.0.1:5001/pdf?filename=result_from_url.pdf&type=url
after building and starting the new image results in a PDF with just the URL printed:
Logs:
[2020-05-22 14:09:06,876] INFO in app: POST /pdf?filename=result_from_url.pdf&type=url
2020-05-22 14:09:06,876 INFO: POST /pdf?filename=result_from_url.pdf&type=url [in /app/app.py:51]
[2020-05-22 14:09:07,698] INFO in app: ==> POST /pdf?filename=result_from_url.pdf ok
2020-05-22 14:09:07,698 INFO: ==> POST /pdf?filename=result_from_url.pdf ok [in /app/app.py:64]
README.md
Outdated
`POST` to `/pdf` can be used to generate a PDF from a URL. Use the `type=url` query parameter and a url in a text/plain body, call: | ||
|
||
``` | ||
curl -v -X POST -H 'Content-Type: text/plain' -d 'https://www.google.ca/?client=safari&channel=iphone_bm'-JLO http://127.0.0.1:5001/pdf?filename=result_from_url.pdf&type=url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl -v -X POST -H 'Content-Type: text/plain' -d 'https://www.google.ca/?client=safari&channel=iphone_bm'-JLO http://127.0.0.1:5001/pdf?filename=result_from_url.pdf&type=url | |
curl -v -X POST -H 'Content-Type: text/plain' -d 'https://www.google.ca/?client=safari&channel=iphone_bm' -JLO http://127.0.0.1:5001/pdf?filename=result_from_url.pdf&type=url |
Did the following to build and run locally;
|
Correct the curl command. Add command to the help response.
Add ability to pass in the url argument to weasyprint.
Can set some of the additional url arguments, see class weasyprint.HTML(input, **kwargs)