[scribus] Introduction & Printing guides

JLuc jluc at no-log.org
Fri Oct 12 18:09:04 UTC 2012


Le 12/10/2012 18:30, José Antonio Rocha a écrit :
> Copy-paste script in (
> http://permalink.gmane.org/gmane.comp.graphics.scribus/39489) led to
> some bad-formated
> lines. The true script is:

Does the script page of the wiki allready proposes this script ?

http://wiki.scribus.net/canvas/Category:Scripts

JLuc




> #!/usr/bin/python
>
> """
> create "printable" guides and page margins for a draft
> @author: ale rimoldi
> @version: 1.0 / 20110901
> @copyright (c) 2011 alessandro rimoldi under the mit license
>             http://www.opensource.org/licenses/mit-license.html
> """
> import sys
> try:
>     import scribus
> except ImportError:
>     print "This script only works from within Scribus"
>     sys.exit(1)
>
> page = scribus.getPageSize()
> margin = scribus.getPageMargins()
>
> layer = scribus.getActiveLayer()
>
> if ('guides' in scribus.getLayers()) :
>      scribus.setActiveLayer('guides')
> else:
>      scribus.createLayer('guides')
>
> # add the page margins
> rectangle = scribus.createRect(margin[1], margin[0], (page[0] - margin[1] -
> margin[2]), (page[1] - margin[0] - margin[3]))
> scribus.setFillColor('none', rectangle)
> scribus.setLineColor('Blue', rectangle)
> scribus.setLineWidth(0.4, rectangle)
>
> # add horizontal and vertical guides
> for item in scribus.getHGuides():
>      line = scribus.createLine(0, item , page[0], item)
>      scribus.setLineColor('Black', line)
>      scribus.setLineWidth(0.6, line)
>      scribus.setLineStyle(scribus.LINE_DASHDOT, line)
>
> for item in scribus.getVGuides():
>      line = scribus.createLine(item, 0 , item, page[0])
>      scribus.setLineColor('Black', line)
>      scribus.setLineWidth(0.6, line)
>      scribus.setLineStyle(scribus.LINE_DASHDOT, line)
>
> # add a "crossed frame" for missing images
> for item in scribus.getAllObjects():
>      if scribus.getObjectType(item) == 'ImageFrame':
>          image = scribus.getImageFile(item)
>          if image == '':
>              pos = scribus.getPosition(item)
>              size = scribus.getSize(item)
>              rectangle = scribus.createRect(pos[0], pos[1], size[0],size[1])
>          scribus.setFillColor('none', rectangle)
>              scribus.setLineColor('Black', rectangle)
>              scribus.setLineWidth(0.4, rectangle)
>              line = scribus.createLine(pos[0], pos[1] , pos[0] + size[0],
> pos[1] + size[1])
>           scribus.setLineColor('Black', line)
>              scribus.setLineWidth(0.4, line)
>              line = scribus.createLine(pos[0], pos[1] + size[1], pos[0] +
> size[0], pos[1])
>          scribus.setLineColor('Black', line)
>              scribus.setLineWidth(0.4, line)
>
> scribus.setActiveLayer(layer)
>
> 2012/10/12 Gabriel Grosso <ggrosso.dg at gmail.com>
>
>> Hi a.l.e,
>>
>> thanks for such a quick answer. We'll be in contact at #scribus.
>> Thanks again!
>>
>>
>> On 10/12/2012 11:06 AM, a.l.e wrote:
>>
>>> hi gabriel,
>>>
>>> here a developer called a.l.e speaking ...
>>>
>>>> Hi all. I'm a 27 years old graphic design student based in Argentina, at
>>>> the University of Art and Design of Oberá, state of Misiones. I use
>>>> GNU/Linux from redhat 4.8 (i guess the first attempt to bring gnu to the
>>>> masses) and now my main OS is Archlinux. I work entirely with open source
>>>> software Gimp, Inkscape, Blender, Scribus. Well, enough of introductions
>>>> and go to the point. I need to do some sketches for a project i'm about to
>>>> make, and i'm wondering if there's a way of "print" the guides and the "no
>>>> printing objects" to a PDF file (maybe to print it in a greaseproof paper).
>>>> I do some research and came to this script developed by a user called
>>>> a.l.e. (http://permalink.gmane.org/**gmane.comp.graphics.scribus/**39489<http://permalink.gmane.org/gmane.comp.graphics.scribus/39489>
>>>> ).
>>>>
>>>> Now in Scribus, importing it and executing throws me an error:
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>    File "", line 8, in
>>>>
>>>>    File "/home/gabo/guides.py", line 30
>>>>
>>>>      scribus.setFillColor('Black', rectangle) scribus.setLineColor('Blue',
>>>>
>>>>                                                     ^
>>>>
>>>> SyntaxError: invalid syntax
>>>>
>>>> I want to know if somebody has used it before or has another turnaround
>>>> to work with printed guides.
>>>> Well, thanks in advance and sorry about my English.
>>>>
>>>>
>>> i can have a look at it this evening CET...
>>>
>>> i think that -- at the end -- frédéric continued his work and "published"
>>> a finished script (which also printed crossed boxes for image fiels, iirc)
>>>
>>> i will be at home between 19 and 21 swiss time. you can ping me on irc...
>>> #scribus on irc.freenode.net
>>> http://wiki.scribus.net/**canvas/Special:WebChat<http://wiki.scribus.net/canvas/Special:WebChat>
>>>
>>> ciao
>>> a.l.e
>>>
>>> ___
>>> Scribus Mailing List: scribus at lists.scribus.net
>>> Edit your options or unsubscribe:
>>> http://lists.scribus.net/**mailman/listinfo/scribus<http://lists.scribus.net/mailman/listinfo/scribus>
>>> See also:
>>> http://wiki.scribus.net
>>> http://forums.scribus.net
>>>
>>
>>
>> ___
>> Scribus Mailing List: scribus at lists.scribus.net
>> Edit your options or unsubscribe:
>> http://lists.scribus.net/**mailman/listinfo/scribus<http://lists.scribus.net/mailman/listinfo/scribus>
>> See also:
>> http://wiki.scribus.net
>> http://forums.scribus.net
>>
>
>
>





More information about the scribus mailing list