[JS] CS4 How to position a graphic within a Frame

I have a JS script that I am converting from CS3 to CS4 and I am finding that the behaviour for positioning a graphic within a frame has changed.  I have code that sets the geometric bounds of a graphic to a negitave value within the frame, within CS3 this works great.  However using the same code on CS4 to set the geometric bounds does not produce the same result.  The graphic is always placed at 0,0 and it ignores the negitive top and left values supplied.
Does anyone know what has changed with the geometric bounds of a graphic within a recrangle frame?  How would I set the position of the graphic within the frame since setting the geometric bounds does not seem to work any longer.
Thanks,
Sheldon

I have yet to determine why the behavior is different from CS3 to CS4 and how to correct the positioning within CS4.  To help explain the problem further I have included a sample script which demonstrates the problem.  I have run the script on both CS3 and CS4 and included screen shots of the results when the resulting INDD file is opened.  Could someone help explain why the position of the image is wrong in CS4 and what I can do to correct the problem?
Here is the sample script ...
for(i=app.documents.count()-1;i>=0;i--){app.documents.item(i).close();}
app.textPreferences.useOpticalSize = false;
app.textPreferences.typographersQuotes = false;
app.textImportPreferences.useTypographersQuotes = false;
app.taggedTextImportPreferences.useTypographersQuotes = false;
app.pasteboardPreferences.minimumSpaceAboveAndBelow = "300p";
app.textFramePreferences.firstBaselineOffset = FirstBaseline.ascentOffset;
app.colorSettings.cmsSettingsPath = File("C:\\etc\\Friesens_Yearbook_Custom_Color_Settings.csf");
app.marginPreferences.top = '24pt';
app.marginPreferences.bottom = '48pt';
app.marginPreferences.left = '36pt';
app.marginPreferences.right = '36pt';
var doc = app.documents.add();
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
doc.documentPreferences.pageHeight = 792;
doc.documentPreferences.pageWidth = 612;
doc.documentPreferences.pageOrientation = PageOrientation.portrait;
doc.documentPreferences.pagesPerDocument = 2;
doc.documentPreferences.facingPages = true;
doc.sections.firstItem().continueNumbering = false;
doc.sections.firstItem().pageNumberStart = 2;
var pg = doc.pages.item(0);
var frm = pg.rectangles.add();
frm.geometricBounds = ['200.5pt','200.2pt','447.8551pt','415.5206pt'];
try{frm.place (File('c:\\test.jpg'), false);}catch(err){};
if(frm.graphics.count() > 0) {frm.graphics.firstItem().geometricBounds = [frm.geometricBounds[0]-147, frm.geometricBounds[1]-49, 407.04+frm.geometricBounds[0]-147, 271.68+frm.geometricBounds[1]-49];};
var objStyle = doc.objectStyles.add();
objStyle.enableStroke= false;
objStyle.transparencySettings.blendingSettings.opacity = 100;
frm.applyObjectStyle(objStyle, true, true);
frm.rotationAngle = 59;
doc.label = '824203.indd';
doc.packageForPrint('c:\\test\\824203\\', true, true, true, true, true, false, '', false, false);
for(i=app.documents.count()-1;i>=0;i--){app.documents.item(i).close();}
The line that I highlighted is the one that adjusts the images position within its frame.  It uses a formula to determine the exact position relative to the containing frames position.  This is why you will see the calculations to determine the geometric bounds.
Here is the result of the script using InDesign Server CS3, notice the position of the image based on the 'Direct Selection Tool' highlight area (this is the desired result):
And, here is the result after running the script against InDesign Server CS4:
As you can see the Image is placed at the lot left corrner of the frame which is wrong.  Any insight into the diffrences in the behavior would be appreciated.
Thanks

Similar Messages

  • How to position a graphic on a page

    I am a realtively new Output Designer user, struggling to figure out how to do some things.
    For this question: I am putting a graphic on the page with ^graph. It shows up partially displayed in the upper right. I presume that is where the pen is at the time.
    How can I position the pen, the graphic, where I want it?
    Brian

    Check out the
    b ^position
    command.
    I prefer to use a "logo" in the designer or a "graphic field" if the graphic and be variable. That way you have easy control of where it goes.

  • Text wrap for a paragraph: How to define the width of a Text box /  active text area? I simply need a longish text to wrap within the frame!

    Hello, I've been searching for a good while in the forums now, but have found no solution or real mention of the problem – I hope some of you can help.
    I want to very simply layout a text between scenes, a slightly longer text that wraps within the frame margins. Here's an example of how I want it to look:
    Now, I couldn't for the life of me get the Custom Text to behave like that, as there are no parameters to set for the width of the text area. The Text Size, yes, along with the Tracking, Baseline and all that, but the width of the text box, no. The above was created by customizing one of the other Text Generator presets that happened to be left aligned.
    However, this preset has a fade in/fade out transition, which I do not want. There's no way to remove this transition as it seems integrated into the Text Generator (meaning they are not really presets, but separate kinds of Text objects? Very silly.)
    So I am asking you: Is there any way to get the Custom Text generator to behave like that? Just a text paragraph as above. Below you'll see all I can manage with the diffferent Custom Text parameters. Any kind of repositioning and resizing of the text just changes the position and size of the frame – but the actual text items are just cropped off where they extend out of that frame. Apparently the bounding box for the text is just some default length, and I can't find any way to adjust the width. See below my different attempts.
    The same text pasted into a Custom Text generator clearly extends outside the frame:
    Here Transform just moves – or resizes – the video frame that the Text Box exists inside:
    The Crop gives similar results, and of course Distort doesn't get me closer to what I need, either. There should be simply a Text Box Width parameter to set somewhere, but if it exists they have hidden it very well. How do you do it?
    Thanks for any help, this is a silly problem, but one of now many trivial problems that amount to me growing quite dissatisfied with FCPX. Hopefully I've just overlooked something.
    All the best,
    Thomas

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • How do I paint graphics in a JFrame created by netbeans GUI builder?

    I hope it's ok to ask netbeans questions here. Frustrated with Eclipse I'm trying netbeans. I went through the tutorial for the UI builder and I have no trouble laying out the usual swing widgets like JPanels, JButtons, etc. What I haven't figured out is how to mix ordinary graphics like Graphics.draw() with these components.
    Crude example: 2 JPanels in a JFrame. The one on the left has a JSlider bar. The one on the right has a line or something that gets bigger or smaller according to the slider bar.
    If I weren't using the UI builder I'd create a new class that is an extension of JPanel, and override paintComponent() with my draw commands. If I did that to a JPanel I layed out with the UI builder it would get lumped in with the protected code that's created on the fly and probably erased.
    So how do I mix swing components with ordinary graphics without breaking the netbeans UI builder form?
    Thanks,
    Apchar

    This forum is a Java language forum. The NetBeans site has a mailing list. Nabble forums also has NB forums. The contents of both are crossposted. So, you really should post NB use questions to one of them. Post only Java language questions here.
    You can add custom code to the guarded (blue) code blocks. Open a component's property window and select the code button at the top. This allows you to insert code in numerous locations within the guarded blocks and retain the code.
    You can also click a component's property's ellipsis (...) button to bring up the Property Editor dialog box, then select "Custom Code" from the dropdown list at the top of the dialog.
    Note: the above instructions are for NB 6

  • How to Position the 3D Rendering Viewport (not using "BasicScene")

    Hi,
    I wrote a custom scene manager which directly manipulating the scenegraph (Instance3D) - I just need some more direct access to it. The 3D view is part of a bigger sourrounding AIR/Flex-based Application, which displays some graphics using convential displaylist. Now I would need to position the 3D rendering area at certain coordinates in relation to the outer main applicaiton window (stage) and application state.
    I was able to replicate most of the internals of "BasicScene" based on the example "Tutorial05_SpriteBased", but I am struggled on how to positioning the 3D rendering area managed by proscenium:
    - BasicScene exposes a "viewport" property that takes a reference to a DisplayObject. It seems like it internally adjusts dimension and position of the stage3D-based rendering area based on that "viewport" x,y,width, and height.
    - I did figure out how to set dimensions of the area (sg is the Instance3D reference):
                                  sg.configureBackBuffer(viewPort.width, viewPort.height, 2, true );
                                  sg.scene.activeCamera.aspect = viewPort.width / viewPort.height;
    - I could not find any way to define a x/y position.
    Any help would be greatly appreciated - probably its just a small thing, but I do not have the source from BasicScene - otherwise I could look it up myself.
    THanks,
    Philipp

    Figured this out how to set the viewport. The Camera exposes a method "setViewport". There is a Demo "TestViewport". The calculation for the viewports top, left, bottom, right values gets more complicated in my case because I have stage scale mode set to StageScaleMode.SHOW_ALL.
    sg.configureBackBuffer(viewPort.stage.fullScreenWidth, viewPort.stage.fullScreenHeight, 2, true );
    sg.scene.activeCamera.aspect = viewPort.stage.fullScreenWidth / viewPort.stage.fullScreenHeight;
    sg.scene.activeCamera.setViewport(true, -0.5, 0.5, -0.5, 0.5 );

  • How do I fit a picture within a frame layer?

    How do I fit a picture within a frame layer?

    If your images are an aspect that does not fit easily into
    a standard video frame, you might need to scale up
    (or preferably down) and reposition your images to fit.
    What are your image dimensions?
    What are your Sequence settings?
    What is the intended destination for your finished video?
    Premiere Pro / Motion: position, scale, and rotate a clip
    http://help.adobe.com/en_US/premierepro/cs/using/WSC7A162B6-6EF1-49e1-8622-8127366710BB.ht ml
    How do I choose the right sequence settings?
    http://www.video2brain.com/en/lessons/how-do-i-choose-the-right-sequence-settings
    Also, make sure you're running the most current update (CS6.0.5).
    Within Premiere:  Help > Updates...

  • Graphics within F1 help

    Hi all,
    has anyone an idea how to insert a graphic into my F1-help.
    It seems that F1 processor has some problems with it because  if I print my dokument the graphic is shown correctly only within performance assistant (or modal f1 window) the graphic is not shown.
    Any help is highly welcomed!
    Thanks!
    Best regards
    Tobias Kugelmann

    You have something called the AWT Event Thread. This is what does all windowing events. If you press a button, the ActionListener is ran in this thread. If you paint the screen, it too is done in this thread.
    Now you are adding delays in the paint method (from the sounds of it), so you send the current thread (which is the AWT event thread) to sleep. Now you application can no longer do anything GUI (hear mouse clicks, repaint other components) while this thread is asleep.
    This is why you are having the problems you are having.
    To fix it you need a datamodel. The circles represent something I would guess, so don't paint circles. Paint Thingies (which are represented by circles).
    The paint method has to be changed so instead of handing the loop, it looks at the data model to see how many Thingies it has to draw, and where.
    You the use a different loop (either main(), or a TimerTask) to add the Thingies into the datamodel, and call repaint.

  • Position shapes / graphics

    Hey,
    Thanks for your help so far.
    I found an example and edited it, it displays a circle, square and line all one after another. Ill post code to show ye;
        package shape;
        import java.awt.Color;
          import java.awt.Graphics;
          import java.awt.BasicStroke; 
          import java.awt.Rectangle;
          import java.awt.Graphics2D;          
          import java.awt.geom.Ellipse2D;      
          import java.awt.geom.Rectangle2D;    
          import java.awt.geom.Arc2D;          
          import java.awt.geom.Line2D;         
          import javax.swing.JPanel;
          public class ShapesJPanel extends JPanel
             // draw shapes with Java 2D API
             public void paintComponent( Graphics g )
                super.paintComponent( g ); // call superclass's paintComponent
                Graphics2D g2d = ( Graphics2D ) g; // cast g to Graphics2D
                // draw 2D ellipse filled with a blue-yellow gradient      
                g2d.setPaint( Color.BLACK);                                 
                g2d.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );        
                // draw 2D rectangle in red                          
                g2d.setPaint( Color.BLACK );                           
                g2d.setStroke( new BasicStroke( 2.0f ) );           
                g2d.draw( new Rectangle2D.Double( 80, 30, 65, 100 ) );
               // draw 2D lines in green and yellow              
                g2d.setPaint( Color.BLACK );                      
                g2d.draw( new Line2D.Double( 395, 30, 320, 150 ) );
             } // end method paintComponent
          } // end class ShapesJPaneland also main to run the JPanel
        package shape;
        import javax.swing.JFrame;
          public class Shapes2
             // execute application
             public static void main( String args[] )
                // create frame for ShapesJPanel
                JFrame frame = new JFrame( "Drawing 2D shapes" );
                frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                // create ShapesJPanel
                ShapesJPanel shapesJPanel = new ShapesJPanel();
                frame.add( shapesJPanel ); // add shapesJPanel to frame
                frame.setSize( 425, 200 ); // set frame size
                frame.setVisible( true ); // display frame
             } // end main  } // end class Shapes            
        }So thats all good, but the thing is i cant seem to apply any BorderLayout to the shapes, i want to display them one after another on new lines.
    eg Circle
    Square
    line
    In that kind of order, opposed to left to right. Can someone tell me how this can be done thanks.
    Mark

    Hey guys
    Another little prob, in my class i have all my shapes created and postioned as best i can, but now in my main method i try and add a label and pass a variable result into it but i either cant display it or absolute position it.
    Apparently with absolute positioning i must set the frame layout to null first then postion the labels but setting the frame to null ends up not displaying my graphics.
    Any other way to absolute position the label and stuff and still keep the graphics displaying.
    BorderLayout manager works but is not accurate enough.
    Mark

  • Is there any way to position a photo within an email?

    When I compose an email, the photo always goes to the bottom of the email, even after forwarded text.
    Is there a way that I can get the program to let me re-position the photo within the text?
    After some experimenting I discovered that I can cut and paste the text after the photo. That will do for now. But that will mean a lot of cutting and pasting if I want to add more photos or rearrange them.
    Is there a setting somewhere that will allow me to drag the photo to the correct place the way I used to do?

    I have now downloaded the .zip file, and extracted it. I have gone into Eclipse to try and import, but can find no .jar type file for which to import, and Eclipse can not "import javax.media.*;" because of this. I am using the sample code that came in the download, so there shouldn't be errors. There aren't any, except for importing, and the use of Classes that would have been imported.
    Any ideas on how to actually import.use them?

  • How can I POST data within the same page if I have a A HREF -tag as input?

    How can I POST data within the same page if I have a <A HREF>-tag as input? I want the user to click on a line of text (from a database) and then some data should be posted.

    you can use like this or call javascript fuction and submit the form
    <form method=post action="/mypage">
    cnmsdesign.doc     
    </form>

  • When I open a file in Photoshop CS4, how can I resize My Open Window File?it is stuck on full screen

    When I Open a File in Photoshop CS4, How can I Resize My Open Window File? It is stuck on Full Screen?

    Which operating system are you using?
    On a windows os, usually one can just double click on the title bar in the open dialog.

  • Need help on how to use conference facility within adobe connect

    I need some help on how to use conference facility within adobe connect?

    I'd recommend you start here: Getting Started with Adobe Connect - Adobe Connect User Community

  • Need direction on how to make motion graphics -AF CS5

    I didn’t know how to word the header for my question so I’ll try to clarify it here. I’m new to AF so please bear with me. In the Adobe tutorial at the link below, he animates a flower. The flower is in front of a colored background and there are some added text that animate as well. I understand about layers but my question is, can I make a graphic like the one in the tutorial in Photoshop CS5 and import it into AF? I just ordered a copy of PS CS5 and have not gotten a chance to work with PS. When I searched the net about my question, I found many links describing how to make web graphics. Would I be making the same thing and saving them not as a web graphic? If I can make something similar to the flower in the tutorial, then I can go from there. I guess what is confusing for me is that the background and flower assets are mp4 (mpeg) video. I thought it would be two graphics in 2 layers, plus additional text as more layers. http://tv.adobe.com/watch/learn-after-effects-cs5/gs05-working-with-layers/

    Thank you Kevin.  I'll kinda figured that would be the be the steps but wasn't real sure. Once I get going in PS, I'll better understand how to do things.
    Wow, lots to learn.

  • How can i set tab within a table?

    how can i set tab within a table?

    With a live insertion point in a cell, type Alt/Opt+TAB, or, right-click and choose > Insert Special Character > Other > Tab, or, press Ctrl/Cmd+Shift+T to bring up the Tabs panel.

  • How can i set songs within a playlist, or an entire playlist, so that they are not included when using the shuffle function on IPOD Classic? Is this possible?

    How can i set songs within a playlist, or an entire playlist, so that they are not included when using the shuffle function on IPOD Classic?
    Is this possible?

    You can set any song to Skip when shuffling.
    In your iTunes Library, highlight the song and right-click/Get Info. On the Options tab is the Skip when shuffling box. Select that and then Sync the iPod with your Library.

Maybe you are looking for

  • Permissions on an external hard drive

    Can someone PLEASE help. I have two external hard drives that when I plug into my MacBook come up as read only. I have tried to use the Get Info and change the Ownership & Permissions settings, but there is no options, it just tells me I can read onl

  • Return material to vendor-CIN scenario

    Hi gurus, 1.Can i know the steps for returning the material to vendor after doing MIRO.-CIN involved 2.Returning the material to vendor after paying  the vendor-CIN involved. regards murugan

  • Why my iphone 4s wont play music

    I cant play my music on my iphone 4s. Does somebody have any idea why??? I dont wanna do all the restore procedure. I only have music purchased from itunes only. It was playing perfect. If i use to play music from youtube website work fine only from

  • Designning code

    I am using control and simulation loop in which nine types of graph ,select this nine graph use case with enum structue.STEP as a input.Also i get proper output but when i use autoscale property then  graph output change.

  • 522 IP REPUTATION BAD (please check for IP address...

    Hello, We are a big hosting provider within the UK with multiple servers and thousands of hosted websites. We have recently migrated a shared hosting server to new hardware and a new set of IPv4 IP addresses (freshly assigned by RIPE). Customers host