Skip to content

Instantly share code, notes, and snippets.

@molszewski
Created January 29, 2014 14:55
Show Gist options
  • Save molszewski/8689702 to your computer and use it in GitHub Desktop.
Save molszewski/8689702 to your computer and use it in GitHub Desktop.
WeasyPrint spike
#!venv/bin/python
# Script requires:
# - virtualenv in venv dir (virtualenv venv)
# - XQuartz-2.7.5 (installed separately)
# - cairo pango gdk-pixbuf libxmllibxslt libffi (brew install cairo pango gdk-pixbuf libxmllibxslt libffi)
# - WeasyPrint (pip install WeasyPrint)
from weasyprint import HTML
HTML('http://weasyprint.org/').write_pdf('weasyprint_spike_output.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment