Skip to content

Instantly share code, notes, and snippets.

@daniel-abramov
Created June 12, 2016 16:30
Show Gist options
  • Save daniel-abramov/8b903834a95b71dd257373db1be35de5 to your computer and use it in GitHub Desktop.
Save daniel-abramov/8b903834a95b71dd257373db1be35de5 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import cairo
sfc = cairo.PDFSurface( open("file.pdf", "w"), 144, 144 )
cr = cairo.Context(sfc)
cr.set_line_width(1)
cr.set_source_rgb(0.5, 0.5, 0.5)
cr.move_to(10, 10)
cr.line_to(30, 30)
cr.stroke()
cr.show_page()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment