html2ogimage - Convert HTML to an Image
Converts a HTML snippet to an image.
html
string
HTML to render as an image. You can use tailwind classes provided in a tw tag in your elements. The following font families are supported: Alegreya, Barlow, Inter, Lato, Montserrat, OpenSans, Oswald, Poppins, PTSans, Raleway, Roboto
Example:
<div>Hello</div>
width
number
The image width.
Minimum: 1
Maximum: 10000
Example:
500
height
number
The image height.
Minimum: 1
Maximum: 10000
Example:
500
outputFormat
string
The desired output format
Possible values are: svg, png, jpg
Example:
png
defaultFont
string
A default font that is injected at top level into your html. Can be overwritten by providing another font-family in a sub element.
Possible values are: Alegreya, Barlow, Inter, Lato, Montserrat, OpenSans, Oswald, Poppins, PTSans, Raleway, Roboto
Example:
OpenSans