Method: SelectPdf::HtmlToPdfClient#convert_html_string_with_base_url

Defined in:
lib/selectpdf.rb

#convert_html_string_with_base_url(html_string, base_url) ⇒ Object

Convert the specified HTML string to PDF. Use a base url to resolve relative paths to resources.

Parameters:

  • html_string

    HTML string with the content being converted.

  • base_url

    Base url used to resolve relative paths to resources (css, images, javascript, etc). Must be a http:// or https:// publicly available url.



851
852
853
854
855
856
857
858
# File 'lib/selectpdf.rb', line 851

def convert_html_string_with_base_url(html_string, base_url)
  @parameters.delete('url')
  @parameters['async'] = 'False'
  @parameters['html'] = html_string
  @parameters['base_url'] = base_url unless base_url.nil? || base_url.empty?

  perform_post
end