[scribus] batch load svg files into scribus

Meaux Mazey meauxmazey at gmail.com
Thu Aug 6 01:34:08 UTC 2020


Hey Greg!
I got it working. Thanks to your help and a little RTFM I was able to get
my script to load a folder of .svg into my document. Its a bit hard coded
one trick pony at the moment but once I have it a bit more streamlined I
will share.

Thanks again
Meaux

On Tue, Aug 4, 2020 at 2:08 PM Meaux Mazey <meauxmazey at gmail.com> wrote:

> Thanks!
> That should get me where I need to be.  The files are sized already.
> You've given me 99% of what I need and I should be able to tinker out the
> custom bits.
>
> Thanks
> Meaux
>
>
> On Mon, Aug 3, 2020, 9:18 AM Gregory Pittman <gpittman at iglou.com> wrote:
>
>> On 8/3/20 2:47 AM, Meaux Mazey wrote:
>> > I'm new to email list servers. I'm not seeing my post on the archive.
>> Do I
>> > need to resend?
>> >
>> >
>> > On Sat, Jul 25, 2020 at 5:59 PM Meaux Mazey <meauxmazey at gmail.com>
>> wrote:
>> >
>> >> Hello world,
>> >> I was looking for a script to batch load svg files into a scribus
>> document.
>> >> I found a thread from 2015 that gave the function placeSVG (filename,
>> x,y)
>> >> one function is not a script.
>> >> Is there a batch script written?
>> >>
>>
>> Hi Meaux,
>>
>> I don't know what happened, but the message never showed up on the 25th.
>>
>> As far as your question, I think that importing SVGs has a lot of
>> considerations that are hard to generalize, since the placeSVG() command
>> just places the SVG without regard to its size.
>> Here is a very small script that just places a chosen SVG at 100, 100 (I
>> use points units).
>>
>> ********
>> #!/usr/bin/env python
>>
>> # File: impsvg.py
>> # Imports SVG to document to current page
>>
>> import scribus
>> import os
>>
>> mySVG = scribus.fileDialog('Select an SVG','SVG files (*.svg)')
>> scribus.placeSVG(mySVG,100,100)
>>
>> ********
>>
>> If you had a number of SVGs in a directory you could put in a command to
>> select a directory, like
>>
>> svgdir = scribus.fileDialog('Select SVG
>> Directory','Directories',isdir=True)
>> d = os.listdir(svgdir)
>> D = []
>> for file in d:
>>     if file.endswith('.svg') or file.endswith('.SVG'):
>>          D.append(file)
>>
>> After this, you would have to have some scheme of where the SVGs would be
>> placed, and go through your list D to place them.
>> This is something like the script I wrote from creating an album of
>> images, though there I had a much wider range to image types to consider,
>> but this used a fixed layout:
>>
>>
>> https://wiki.scribus.net/canvas/Automatic_import_of_images:_Versions_not_requiring_Tkinter
>>
>> Hopefully that's enough to get you started.
>>
>> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20200805/57fc3c17/attachment.htm>


More information about the scribus mailing list