Forum How do I...?

[python] how to add bootstrap?

chenzhuo
I use python to call Prince, I read the document, but it only give a simple example like this:
p = Popen(["prince.exe","-","out.pdf"], stdin=PIPE)
p.stdin.write(result_html.encode('utf-8'))
p.stdin.close()

And my html is use bootstrap, but the pdf dosen't have it.
How to add the bootstrap.css in it? Please write the code
mikeday
It helps to start by running Prince from the command-line manually first, and checking the output log for warnings in case some style sheets cannot be loaded.

You can apply style sheets from the command-line with the --style argument, or you can just reference them from within the document with the <style> element or <link rel='stylesheet'>.