[scribus] Changing page size from a script

Adam adam at photosynth.ca
Mon Jul 23 23:00:56 UTC 2012


Thanks Greg! In fact I had already taken apart the InfoBox script and 
reused some pieces. It threw an error on the PIL import, so I'm not 
using the Image library yet, but I will definitely have another go at it 
if I find a way to resize the pages.

I don't have the source (yet), but I did see that DLL in the plugins 
directory and suspected it was related. I'm not really thrilled at the 
idea of trying to build Scribus from source (on Windows :( ) anyhow, so 
I'll try to work around this for now.

Thanks for your reply,
Adam



On 23/07/2012 2:03 PM, Gregory Pittman wrote:
> On 07/23/2012 04:32 PM, Adam wrote:
>> Hello,
>> I'm using a script to automatically lay out a file of scanned images,
>> one image per page. Ideally, I'd like to be able to change the page size
>> to match the image dimensions. I haven't seen a way to do this from a
>> script. Does anyone know if this is possible?
>>
>> A related question: where are the Scribus python functions/methods that
>> are available from scripts defined? Is there some way to define new
>> functions?
>>
> First part:
>
> If you have an svn version of Scribus, you can look at InfoBox.py for
> the commands for the PIL (Python Imaging Library)
>
> # at the beginning, here is where I try to import the library
>
> pil_found = 1
>
> try:
>      from PIL import Image
> except ImportError:
>      pil_found = 0
>
> # later, here is how to make use of it (imageload is the variable for
> the image filename):
>
>              if (pil_found == 1):
>                  im = Image.open(imageload)
>                  xsize, ysize = im.size
>
> so you can then use the dimensions to decide on your document page size.
>
> Second part:
>
> If you have Scribus source, it's in scribus/plugins/scriptplugin. I
> wouldn't spend time making modifications in the current Scripter, since
> a new version is coming with a very different method for creating new
> Scripter commands.
>
> Greg
>
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
>




More information about the scribus mailing list