class Wkhtmltopdf::WkImage

Defined in:

wkhtmltopdf/wk_image.cr

Constant Summary

FORMATS = ["jpg", "png", "bmp", "svg"]

Output formats available

Constructors

Instance Method Summary

Constructor Detail

def self.new(path = "") #

Init default values

  • path: string with an output file path (extension included)

[View source]

Instance Method Detail

def buffer : Slice(UInt8)? #

Buffer used for in-memory generation (available if no output is specified)


[View source]
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)

[View source]
def set(key : String, value : String) #

Set an option

  • key: string with key name
  • value: string with setting value

NOTE for available settings see pagePdfObject


[View source]
def set_output(path : String) #

Set output path

  • path: string with an output file path (extension included)

[View source]
def set_url(url : String) #

Set URL to fetch content from

  • url: string with a complete URL (schema included)

[View source]