Skip to main content
Participating Frequently
June 25, 2009
Answered

adding image

  • June 25, 2009
  • 1 reply
  • 671 views

Hi all,

I want to add a picture and rotate it with script.

I know the file path, the page and the coordiantes.

I also know the rotation angle,

Do you have an example how to do this with VBScript?

Thanks

Yael

This topic has been closed for replies.
Correct answer Robert at ID-Tasker

you can try this:

set myInDi = CreateObject("InDesign.Application")

set myDoc = myInDi.ActiveDocument

set myPage = myDoc.Pages.Item(1)

set myRect = myPage.Rectangles.Add

myRect.GeometricBounds = Array(0,0,100,100)

call myRect.Place("C:\image.tif")

call myRect.Fit(1667591779)

' 1667591779 = idFitOptions.idCenterContent

myRect.RotationAngle = 90

you need to change page number, GeometricBounds (y1,x1,y2,x2), path to image and rotation angle

robin

www.adobescripts.co.uk

1 reply

Robert at ID-Tasker
Robert at ID-TaskerCorrect answer
Legend
June 26, 2009

you can try this:

set myInDi = CreateObject("InDesign.Application")

set myDoc = myInDi.ActiveDocument

set myPage = myDoc.Pages.Item(1)

set myRect = myPage.Rectangles.Add

myRect.GeometricBounds = Array(0,0,100,100)

call myRect.Place("C:\image.tif")

call myRect.Fit(1667591779)

' 1667591779 = idFitOptions.idCenterContent

myRect.RotationAngle = 90

you need to change page number, GeometricBounds (y1,x1,y2,x2), path to image and rotation angle

robin

www.adobescripts.co.uk

yael876Author
Participating Frequently
June 28, 2009

Hi Robert,

Thanks it exactly what i want!

Yael