Feature - accept content to render pdf by url - #5
Open
usingtechnology wants to merge 3 commits into
Open
usingtechnology wants to merge 3 commits into
usingtechnology wants to merge 3 commits into
Conversation
Add ability to pass in the url argument to weasyprint.
WadeBarnes
requested changes
May 21, 2020
WadeBarnes
left a comment
Member
There was a problem hiding this comment.
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.
Member
WadeBarnes
requested changes
May 22, 2020
Member
There was a problem hiding this comment.
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]
| `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 |
Member
There was a problem hiding this comment.
Suggested change
| 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 |
Member
|
Did the following to build and run locally; |
Correct the curl command. Add command to the help response.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Add ability to pass in the url argument to weasyprint.
Can set some of the additional url arguments, see class weasyprint.HTML(input, **kwargs)