Created
September 17, 2015 09:34
-
-
Save aoloe/7a841035e68345999da3 to your computer and use it in GitHub Desktop.
fixing scribus/scribus/plugins/scriptplugin/samples/3columnA4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Creates 3 column layout on A4 paper and save it under 3columnA4.sla filename. | |
This is a simple way to demonstrate creating a doc on the fly. | |
""" | |
try: | |
# Please do not use 'from scribus import *' . If you must use a 'from import', | |
# Do so _after_ the 'import scribus' and only import the names you need, such | |
# as commonly used constants. | |
import scribus | |
except ImportError: | |
print "This script only runs from within Scribus." | |
sys.exit(1) | |
# import your-other-modules.py | |
margins = (50, 50, 50, 50) | |
size = (612, 792) | |
def main(): | |
if newDocument(PAPER_A4, margins, LANDSCAPE, 1, UNIT_POINTS, NOFACINGPAGES, FIRSTPAGELEFT,1): | |
a = createText(50, 50, 230, 495) | |
setTextAlignment(1,a) | |
setText("Column A", a) | |
setFontSize(12, a) | |
b = createText(280, 50, 230, 495) | |
setTextAlignment(1,b) | |
setText("Column B", b) | |
setFontSize(12, b) | |
c = createText(510, 50, 230, 495) | |
setTextAlignment(1,b) | |
setText("Column C", c) | |
setFontSize(12, c) | |
saveDocAs("3columnA4.sla") | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment