Skip to content

Instantly share code, notes, and snippets.

@aoloe
Created September 17, 2015 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aoloe/7a841035e68345999da3 to your computer and use it in GitHub Desktop.
Save aoloe/7a841035e68345999da3 to your computer and use it in GitHub Desktop.
fixing scribus/scribus/plugins/scriptplugin/samples/3columnA4.py
# -*- 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