Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Sample1.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 
00004 """ A sample script """
00005 
00006 import sys
00007 
00008 try:
00009     from scribus import *
00010 except ImportError:
00011     print "This script only runs from within Scribus."
00012     sys.exit(1)
00013 
00014 margins = (10, 10, 10, 30)
00015 
00016 def main():
00017     if newDocument(PAPER_A4, margins, PORTRAIT, 1, UNIT_POINTS, NOFACINGPAGES, FIRSTPAGERIGHT, 1):
00018         a = createText(50, 50, 200, 80)
00019         setText("A Test for Scribus", a)
00020         setFontSize(20, a)
00021         b = createEllipse(267, 391, 60, 60)
00022         setFillColor("Red", b)
00023         saveDocAs("Sample1.sla")
00024 
00025 if __name__ == '__main__':
00026     main()