Article View: adobe.scripting.indesign
Article #20485Re: Size of a image
From: Benny Johnson
Date: Tue, 16 Jul 2002 01:47
Date: Tue, 16 Jul 2002 01:47
24 lines
1820 bytes
1820 bytes
Have a look at this code:
Dim myInDesign As InDesign.Application
Dim myDocument As InDesign.Document
Dim myPage As InDesign.Page
Dim dblScalFac As Double
dblScaleFac = 50
Set myInDesign = CreateObject("InDesign.Application.2.0")
����Set myDocument = myInDesign.Documents.Open(path_vierge)
����Set myPage = myDocument.Pages.Item(1)
����myFile = path_photos & "vp_1.eps"
����Set myImage = myPage.Place(myFile, Array(10, 5))
Set currentSelection = myPage.PageItems.Item(1)
Rem PageItem.Item(1) will select the most recently placed item on the page
��������������currentSelection.Resize dblScalFac, dblScalFac, Indesign.idTopLeftAnchor
Essentially, the problem came from the fact that you were trying to use GeometricBounds instead of Resize. In this example, I used a scaling factor of 50% to resize each image dimension, so the images will be half of their original size. You can change this to suit your needs.
Does this help?
Thanks,
-Benny
Technical Details
Message-ID:
<ef9972f.0@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef9972f.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,3784e8404ee6ce93 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-07-15 19:11:59 PST From: "Benny Johnson" <allstarx22@aol.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Size of a image Message-ID: <ef9972f.0@WebX.aaQKaf7vad4> Date: Mon, 15 Jul 2002 18:47:35 -0700 References: <ef9972f.-1@WebX.aaQKaf7vad4> Lines: 29 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit