Method: Pdfcrowd::HtmlToPdfClient#setElementToConvert

Defined in:
lib/pdfcrowd.rb

#setElementToConvert(selectors) ⇒ Object

Convert only the specified element from the main document and its children. The element is specified by one or more CSS selectors. If the element is not found, the conversion fails. If multiple elements are found, the first one is used.

  • selectors - One or more CSS selectors separated by commas. The string must not be empty.
  • Returns - The converter object.


1406
1407
1408
1409
1410
1411
1412
1413
# File 'lib/pdfcrowd.rb', line 1406

def setElementToConvert(selectors)
    if (!(!selectors.nil? && !selectors.empty?))
        raise Error.new(Pdfcrowd.create_invalid_value_message(selectors, "selectors", "html-to-pdf", "The string must not be empty.", "set_element_to_convert"), 470);
    end
    
    @fields['element_to_convert'] = selectors
    self
end