Back to index

scribus-ng  1.3.4.dfsg+svn20071115
3columnUSLTR.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 
00004 """ Creates 3 column layout on US Letter  paper and save it under 3columnUSLTR.sla filename. This is a simple way to demonstrate creating a doc on the fly. """
00005 
00006 try:
00007     # Please do not use 'from scribus import *' . If you must use a 'from import',
00008     # Do so _after_ the 'import scribus' and only import the names you need, such
00009     # as commonly used constants.
00010     import scribus
00011 except ImportError,err:
00012     print "This Python script is written for the Scribus scripting interface."
00013     print "It can only be run from within Scribus."
00014     sys.exit(1)
00015 
00016 def main(argv):
00017     """This is a simple way to demonstrate creating a doc on the fly. """
00018 
00019     pass    # <--- Delete this line
00020 
00021 
00022 import sys
00023 
00024 try:
00025     from scribus import *
00026 except ImportError:
00027     print "This script only runs from within Scribus."
00028     sys.exit(1)
00029 
00030 margins = (50, 50, 50, 50)
00031 size = (612, 792)
00032 
00033 def main():
00034     if newDocument(PAPER_LETTER, margins, LANDSCAPE, 1, UNIT_POINTS, NOFACINGPAGES, FIRSTPAGELEFT, 1):
00035         a = createText(50, 50, 230, 512)
00036         setTextAlignment(1,a)
00037         setText("Column A", a)
00038         setFontSize(12, a)
00039         b = createText(280, 50, 230, 512)
00040         setTextAlignment(1,b)
00041         setText("Column B", b)
00042         setFontSize(12, b)
00043         c = createText(510, 50, 230, 512)
00044         setTextAlignment(1,b)
00045         setText("Column C", c)
00046         setFontSize(12, c)
00047         #saveDocAs("3columnUS.sla")
00048         
00049 
00050 if __name__ == '__main__':
00051     main()