[scribus] Adjust Frame to Image under script

Mátis Barnabás sr_barna at citromail.hu
Thu Mar 26 20:43:02 CET 2009

> /How I can call "Adjust Frame to Image/" function from a script? Under
> scripting references there are nothing about this.

Try this:

## Adjust Frame to Image
## First select the frame of the image
saveUnit = setUnit(UNIT_POINTS)
obj = getSelectedObject()
frameW = getProperty(obj, "width")
frameH = getProperty(obj, "height")
saveScaleX = getProperty(obj, "imageXScale")
saveScaleY = getProperty(obj, "imageYScale")
setScaleImageToFrame(True, False, obj)
fullScaleX = getProperty(obj, "imageXScale")
fullScaleY = getProperty(obj, "imageYScale")
setScaleImageToFrame(False, False, obj)
scaleImage(saveScaleX, saveScaleY, obj)
imageW = frameW * (saveScaleX / fullScaleX)
imageH = frameH * (saveScaleY / fullScaleY)
sizeObject( imageW, imageH, obj )
setUnit( saveUnit )

(win xp, Scribus


More information about the scribus mailing list