Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
baseplate-admin committed May 6, 2024
1 parent c048f21 commit fe33a89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions docs/resvg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ Resvg Module

.. currentmodule:: resvg_py.svg_to_base64

.. function:: svg_to_base64(svg:str,width:int|None=None,height:int|None=None,zoom:int|None=None,dpi:int|None=None,resources_dir:width:str|None=None,languages:list[str]|None=None,font_size:float|None=None,font_family:str|None=None,serif_family:str|None=None,sans_serif_family:str|None=None,cursive_family:str|None=None,fantasy_family:str|None=None,monospace_family:str|None=None,font_files:list[str]|None=None,font_dirs:list[str]|None=None,shape_rendering:"optimize_speed"|"crisp_edges"|"geometric_precision"="geometric_precision",text_rendering:"optimize_speed"|"optimize_legibility"|"geometric_precision"="optimize_legibility",image_rendering:"optimize_quality"|"optimize_speed"="optimize_quality",background:str|None=None) -> str
.. function:: svg_to_base64(svg_str:str,svg_path:str,width:int|None=None,height:int|None=None,zoom:int|None=None,dpi:int|None=None,resources_dir:width:str|None=None,languages:list[str]|None=None,font_size:float|None=None,font_family:str|None=None,serif_family:str|None=None,sans_serif_family:str|None=None,cursive_family:str|None=None,fantasy_family:str|None=None,monospace_family:str|None=None,font_files:list[str]|None=None,font_dirs:list[str]|None=None,shape_rendering:"optimize_speed"|"crisp_edges"|"geometric_precision"="geometric_precision",text_rendering:"optimize_speed"|"optimize_legibility"|"geometric_precision"="optimize_legibility",image_rendering:"optimize_quality"|"optimize_speed"="optimize_quality",background:str|None=None) -> str

:param svg: A string containing valid svg.
:type svg: string
:param svg_str: A string containing valid svg.
:type svg_str: string

:param svg_path: A path to a valid svg.
:type svg_str: string

:param width: An Integer containing the pixels size for width.
:type width: int or None
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We can convert it to `PNG` by:
</svg>
"""
print(resvg_py.svg_to_base64(svg_string))
print(resvg_py.svg_to_base64(svg_string=svg_string))
This should return the following **PNG** image (check using inspect element):
Expand All @@ -51,7 +51,7 @@ We can also do something like this :
svg = ... # path to svg file
print(resvg_py.svg_to_base64(svg))
print(resvg_py.svg_to_base64(svg_path=svg))
Expand Down

0 comments on commit fe33a89

Please sign in to comment.