🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9824

Using the viewZoomStyle(fitPage); JavaScript

#9824
From: John_Kordas
Date: Wed, 19 Jul 2006 05:15
39 lines
1961 bytes
I have a script that lets you select a file key in the size of the document to place the file. In the document setup you have the options to set the height and width of the doc and a bleed and margin value, you can also set the frame to scale proportionally, center and fit frame to content.

It all works well expect I can not seem to get the display to fit to page part to work.

I am creating this for CS2 in JavaScript. This is what I have for creating the document:

var myDocument = app.documents.add();
with(myDocument.documentPreferences){
pageHeight = myHeight;
pageWidth = myWidth;
pageOrientation = PageOrientation.portrait;
with (myDocument.pages.item(0).marginPreferences){
columnCount = 1;
columnGutter = 0;
bottom = myMargin;
left = myMargin;
right = myMargin;
top = myMargin;
}
with(myDocument){
var myPage = pages[0];
with(myPage){
var myFrame = pages.item(0).rectangles.add({strokeWeight:0, strokeColor:myDocument.swatches.item("None")});
with(myFrame){
geometricBounds = myGetBounds(myDocument, myPage);
myFile = myFrame.place( File(myFile), false );
if(myFitProportional){
			myFrame.fit(FitOptions.proportionally);
		}
		if(myFitCenterContent){
			myFrame.fit(FitOptions.centerContent);
		}
		if(myFitFrameToContent){
			myFrame.fit(FitOptions.frameToContent);
		}

Any suggestions would be greatly appreciated.

Regards, John.
Technical Details
Message-ID: <3bc0f5df.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,58f6074201e7122e,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: John_Kordas@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Using the viewZoomStyle(fitPage); JavaScript
Message-ID: <3bc0f5df.-1@webcrossing.la2eafNXanI>
Date: Tue, 18 Jul 2006 22:15:20 -0700
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing