[scribus] Placing /Scaling and file image/PDF size

alessandro rimoldi ale.comp_06 at xox.ch
Wed Oct 29 23:38:21 CET 2008


hi

> GAWD! What have I gotten myself into...? ;)
> I'm not up to something this deep into non gui-ness

... you may have to learn how to swim in the guinness...



here you have the script to find out the width and the height of every picture in a .sla file:


=== 8< ===

#!/usr/bin/python
import re

file = ""
width = 0
height = 0


pf = re.compile('PFILE="([^"]+)')
pw = re.compile('WIDTH="([^"]+)')
ph = re.compile('HEIGHT="([^"]+)')

f=open('/home/ale/test.sla', 'r')
for line in f:
    if 'PTYPE="2"' in line :
        m = pf.search(line)
        if m :
            file = m.group(1)
            width = pw.search(line).group(1)
            height = ph.search(line).group(1)

            print file, width, height

=== 8< ===


it's doable... but since you're scared by the python, i guess it's better not to give you the last part: resize the images with PIL or imagemagik: i don't want to be held responsible for some deletion of files on your system!



good night!
a.l.e




More information about the scribus mailing list