Skip to content

Commit

Permalink
update: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vvanglro committed Nov 9, 2022
1 parent b0a0cf6 commit 6b243d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Render fill:
When `local_render` is equal to true, jinja2 template syntax will be used to render filled html,
If html needs to use local static resources, you need to set `static_root`,
If you want to render filled data dynamically to generate pdf(Based on jinja2), try the following method👇

```python
import asyncio
import pathlib
Expand All @@ -60,14 +61,13 @@ from pwhtmltopdf import HtmlToPdf

async def this_render_from_url():
file_path = pathlib.Path("tests/images.html").absolute()
htp = HtmlToPdf(static_root="tests/static")
await htp.from_url(
f"file://{file_path}",
"tests/effect/from_url/local_url_render.pdf",
local_render=True,
char_code=123,
)
await htp.close()
async with HtmlToPdf(static_root="tests/static", wait_until="load", print_background=True) as htp:
await htp.from_url(
f"file://{file_path}",
"tests/effect/from_url/local_url_render.pdf",
local_render=True,
char_code=123,
)


async def this_render_from_file():
Expand Down

0 comments on commit 6b243d2

Please sign in to comment.