Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Specify css when converting to pdf #5

#1

GitHub Issue 98

How can I specify a custom css file to be used in a pdf conversion?

  • replies 1
  • views 4.5K
  • likes 0
#2

@mkanada, since the PDF converter takes HTML you can add the CSS to the HTML before passing it to the exportToPdf method by wrapping the rendered HTML in <html><head>....</head><body> and </body> with CSS given by:

<link rel="stylesheet" href="file://....">

or

<link rel="stylesheet" href="http://....">

or by using <style>....</style> to embed the CSS into the HTML.