class Wkhtmltopdf::WkPdf

Defined in:

wkhtmltopdf/wk_pdf.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path = "", force_init = false) #

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, do_init = true) #

Convert to PDF

  • html: HTML string used as content, if omitted (or nil) a URL to fetch is required (using #set_url)

[View source]
def deinitialize #

Deinitialize the library, required only if force_init option is used


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

Pdf object settings

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

NOTE for available settings see pagePdfObject


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

Pdf global settings

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

NOTE for available settings see pagePdfGlobal


[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]