home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 November / CPNL0711.ISO / beeld / teken / scribus-1.3.3.9-win32-install.exe / share / samples / Sample1.py < prev    next >
Text File  |  2007-03-13  |  601b  |  27 lines

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. """ A sample script """
  5.  
  6. import sys
  7.  
  8. try:
  9.     from scribus import *
  10. except ImportError:
  11.     print "This script only runs from within Scribus."
  12.     sys.exit(1)
  13.  
  14. margins = (10, 10, 10, 30)
  15.  
  16. def main():
  17.     if newDocument(PAPER_A4, margins, PORTRAIT, 1, UNIT_POINTS, NOFACINGPAGES, FIRSTPAGERIGHT, 1):
  18.         a = createText(50, 50, 200, 80)
  19.         setText("A Test for Scribus", a)
  20.         setFontSize(20, a)
  21.         b = createEllipse(267, 391, 60, 60)
  22.         setFillColor("Red", b)
  23.         saveDocAs("Sample1.sla")
  24.  
  25. if __name__ == '__main__':
  26.     main()
  27.