class Wkhtmltopdf::WkImage
- Wkhtmltopdf::WkImage
- Reference
- Object
Defined in:
wkhtmltopdf/wk_image.crConstant Summary
-
FORMATS =
["jpg", "png", "bmp", "svg"]
-
Output formats available
Constructors
-
.new(path = "")
Init default values
Instance Method Summary
-
#buffer : Slice(UInt8)?
Buffer used for in-memory generation (available if no output is specified)
-
#convert(html = nil)
Convert to image
-
#set(key : String, value : String)
Set an option
-
#set_output(path : String)
Set output path
-
#set_url(url : String)
Set URL to fetch content from
Constructor Detail
def self.new(path = "")
#
Init default values
path
: string with an output file path (extension included)
Instance Method Detail
def buffer : Slice(UInt8)?
#
Buffer used for in-memory generation (available if no output is specified)
def convert(html = nil)
#
Convert to image
html
: HTML string used as content, if omitted (or nil) a URL to fetch is required (using#set_url
)
def set(key : String, value : String)
#
Set an option
key
: string with key namevalue
: string with setting value
NOTE for available settings see pagePdfObject
def set_output(path : String)
#
Set output path
path
: string with an output file path (extension included)
def set_url(url : String)
#
Set URL to fetch content from
url
: string with a complete URL (schema included)