Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Server Developers
Viewing all articles
Browse latest Browse all 20709

Javascript - added images display as grey boxes

$
0
0

I am attempting to add an Image to an InDesign document via a javascript that I am executing via the RunScript() soap method of InDesign Cs4 server.  The script I am using to add an image is something similar to this:

 

var imageFile = File("//c/images/animage.pdf");
var imageGraphic = myDocument.pages.item(0).place(imageFile, null, imageLayer);
imageGraphic = imageGraphic[0];
var imageFrame = imageGraphic.parent;
imageFrame.geometricBounds = [IMAGE_TOP_Y, IMAGE_TOP_X, IMAGE_BOTTOM_Y, IMAGE_BOTTOM_X];
imageFrame.fit(FitOptions.proportionally);
imageFrame.fit(FitOptions.frameToContent);

 

The script adds the image correctly, but when I pull up the document with InDesign, the Images are displayed as grey boxes.  I am able to fix this within InDesign designer by manually setting the "Display Performance" to "High Quality" through the menus, but I need to handle this via the script run on the server.  I attempted to update the script to the following:

 

var imageFile = File("//c/images/animage.pdf");
var imageGraphic = myDocument.pages.item(0).place(imageFile, null, imageLayer);
imageGraphic = imageGraphic[0];
var imageFrame = imageGraphic.parent;
imageFrame.geometricBounds = [IMAGE_TOP_Y, IMAGE_TOP_X, IMAGE_BOTTOM_Y, IMAGE_BOTTOM_X];
imageFrame.fit(FitOptions.proportionally);
imageFrame.fit(FitOptions.frameToContent);

 

//HERE IS THE NEW LINE
imageFrame.localDisplaySetting = DisplaySettingOptions.HIGH_QUALITY;

 

This script runs without problems within the CS4 ExtendScript Toolkit on my local pc.  However, when I run the script against the InDesign CS4 server, I get the following error:

 

Error Number: 55
Error String: Object does not support the property or method 'localDisplaySetting'

 

Does anyone have any advice on how I should proceed?  My main goal is to have the image display correctly without the grey box.


Viewing all articles
Browse latest Browse all 20709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>