Method: Pdfcrowd::HtmlToImageClient#setCustomJavascript

Defined in:
lib/pdfcrowd.rb

#setCustomJavascript(javascript) ⇒ Object

Run a custom JavaScript after the document is loaded and ready to print. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, …). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.

  • javascript - A string containing a JavaScript code. The string must not be empty.

  • Returns - The converter object.



2998
2999
3000
3001
3002
3003
3004
3005
# File 'lib/pdfcrowd.rb', line 2998

def setCustomJavascript(javascript)
    if (!(!javascript.nil? && !javascript.empty?))
        raise Error.new(Pdfcrowd.create_invalid_value_message(javascript, "setCustomJavascript", "html-to-image", "The string must not be empty.", "set_custom_javascript"), 470);
    end
    
    @fields['custom_javascript'] = javascript
    self
end