[Scribus] Perhaps another stupid question ...

Louis Desjardins louisdesjardins
Sun Apr 9 18:18:03 CEST 2006


>Le Sat, 08 Apr 2006 16:28:11 +0200, Thomas Zastrow
><listen at thomas-zastrow.de> m'a transmis le message suivant :
>
>>  Louis, is there another way to create a lot of pages with automatic
>>  (chained) text-frames on them? The task is to import a long piece of
>>  text which needs a lot of pages (app. 100 pages). I'm too lazy to
>>  create each page manually, adding text-frames, chaining them
>>  together .. ;-)

Also, in the New document dialog, you can check the Automatic text 
frame option. Import your text in the first page. The text frame will 
show the overflow symbol in the lower right corner. Go to Page > 
Insert and insert 100 pages. They will all be linked and your text 
will flow. If you need more pages, just add them through the same 
menu. The link is automatic.

One warning! This may result in slow redraw. I've encountered this 
with 1.3.x version. The most recent version seems to work fine but 
you'll have to decide for yourself wether this works or not.

The workaround to this is to create smaller documents and merge them 
in the end if needed.

HTH

Louis


>Scribus' script can do that. I repost here an example that works for me.
>
>----------------------------------------------------------------------------
>#!/usr/bin/env python
># -*- coding: utf-8 -*-
>
>""" Create text frames on all pages """
>
>import sys
>
>
>try:
>	from scribus import *
>except ImportError:
>	print "This script only runs from within Scribus."
>	sys.exit(1)
>
>
>if haveDoc():
>	page = long(valueDialog('Begin','Where I begin ?'))
>	end = long(valueDialog('End','Where I stop ?'))
>	xp = float(valueDialog('x value', 'Please give me an x value 
>for even pages'))
>	yp = float(valueDialog('y value', 'Please give me an y value 
>for even pages'))
>	wp = float(valueDialog('w value', 'Please give me an width 
>value for even pages')) 
>	hp = float(valueDialog('h value', 'Please give me an height 
>value for even pages'))
>	#messageBox("parametres", str([xp,yp,wp,hp]))
>	xi = float(valueDialog('x value', 'Please give me an x value 
>for odd pages'))
>	yi = float(valueDialog('y value', 'Please give me an y value 
>for odd pages'))
>	wi = float(valueDialog('w value', 'Please give me an width 
>value for odd  pages'))
>	hi = float(valueDialog('h value', 'Please give me an height 
>value for odd  pages'))
>  	names=[]
>
>	while page <= end :
>		if page % 2 == 0 :
>			try:
>				gotoPage(page)
>				names.append(createText(xp, yp, wp, hp))
>				lockObject(names[-1])
>			except  IndexError :
>				break
>		else:
>			try:
>				gotoPage(page)
>				names.append(createText(xi, yi, wi, hi))
>				lockObject(names[-1])
>
>			except  IndexError :
>				break
>		page += 1
>
>	for n in range(len(names) - 1) :
>		try :
>			linkTextFrames(names[n], names[n+1])
>
>		except ScribusException :
>			messageBox("Erreur", "Due to error, linking 
>of text frames is left unfinished", ICON_WARNING )
>			break
>
>
>
>else:
>         messageBox(TITLE, "No document open", ICON_WARNING)
>-----------------------------------------------------------------------------------------
>
>
>
>--
>Pierre Marchand
>JabberId : capparis at im.apinc.org
>_______________________________________________
>Scribus mailing list
>Scribus at nashi.altmuehlnet.de
>http://nashi.altmuehlnet.de/mailman/listinfo/scribus




More information about the scribus mailing list