schacon / showoff

moved to puppetlabs/showoff!
2.41k stars 23 forks source link

CSS and PDF VS CSS and HTML :: PDF should use same style as HTML #113

Open robotarmy opened 12 years ago

robotarmy commented 12 years ago

The HTML generated for the PDF is correct - however the PDF rendering is not the same.

HTML PDF

  def pdf(static=true)
      @slides = get_slides_html(static)
      @no_js = false
      html = erb :onepage
      File.open("/tmp/presto.html",File::CREAT|File::TRUNC|File::RDWR) {|f|
        f << html
      }
      # TODO make a random filename

      # PDFKit.new takes the HTML and any options for wkhtmltopdf
      # run `wkhtmltopdf --extended-help` for a full list of options
      kit = PDFKit.new(html, :page_size => 'Letter', :orientation => 'Landscape')

      # Save the PDF to a file
      file = kit.to_file('/tmp/preso.pdf')
    end
robotarmy commented 12 years ago

thank you

robotarmy commented 12 years ago

the PDF Print function in WebKit is ignoring the font/size of the html document that it is printing