How to fit frame to content when content contains anchored text box?

Hi there
I am creating a series of inline text frames within a text frame. Each of these inline frames contains text which includes an anchored text frame. If I tell my inline frames to fit to content they seem to ignore the anchored frames contained therein. Is there any way I can get them to consider the anchored frames they contain when they fit to content?
I tried checking the geometric bounds of my anchored frame before and after its parent frame has fitted to content. Even when there has been no change in position the bounds after fitting to content seem to give numbers way off. I thought I might be able to reset the geometric bounds of the containing frame manually if the anchored frame therein had moved with the fit frame to content.
Here is a snippet of my code:
var anchoredBounds = anchoredFrame.geometricBounds;
mainFrame.fit(FitOptions.FRAME_TO_CONTENT);
mainFrame.texts.item(0).recompose;
var newAnchoredBounds = anchoredFrame.geometricBounds;
alert(anchoredBounds[0] + "; " + newAnchoredBounds[0]);
So “mainFrame” is the text frame containing text and the anchored frame, “anchoredFrame”. “anchoredBounds[0]” seems to correlate with the top edge of the frame when I check it manually after the script has finished (when it hasn’t move with the fit to content). “newAnchorBounds[0]”, however, always gives numbers that are way off every time. Any ideas why this would be the case?
And most importantly, can anyone suggest how I can get my “mainFrame” to consider the “anchoredFrame” contained in it when it fits to content?
I’m using CS4 on a PC. Let me know if it would help to post more code, or if I haven’t explained myself clearly enough.

Is there any way I can get them to consider the anchored frames they contain when they fit to content?
@Graham – as long as ALL the anchored text frames are "inline" text frames,
mainFrame.fit(FitOptions.FRAME_TO_CONTENT);
should work as expected or at least sort of *.
Without calculating anything at all.
Just tested in InDesign CS5.5 (v7.5.3).
Could it be that CS4 will fail on that?
Of course, you can only rely on this, if the main text frame contains any "real" text at all. Not only the  special characters representations of the "inline" text frames. In that case the fit() method will do nothing at all.
* it's debatable, if the fit() method yields desirable output.
It depends on your expectations.
See the following examples:
1. Case 1:
Text frame before fitting:
2. Case 1:
After fitting with the UI command, context menu: "fit frame to contents"
(note the gap between the last baseline of the text and the text frame; note also  the new width)
Is that the result you would expect? I guess not.
3. Case 1:
After fitting  programmatically with myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
4. Case 2:
Before fitting
same text frame as in #1, but different height
5. Case 2:
After fitting with the UI command, context menu: "fit frame to contents"
A different width than in #2 and a gap at the bottom of the text frame!
Not the desired result, I'd say…
6. Case 2:
After fitting  programmatically with myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
Same result as in #3
So with scripting we could, at least, get consistent results.
Of course, you could get the same results in the UI, if you double-click on the bottom center control point…
Maybe it helps, if you are showing us some screen grabs:
1. Your starting point
2. The desired result
Uwe

Similar Messages

  • Can someone tell me how to set my name so when I send a text it shows up instead of my phone number

    Can someone tell me how to set my name so when I send a text it shows up instead of my phone number

    You can't do that. Only the sending number is transmitted by the carrier with an SMS message. If the recipient has you in their address book, with most smart phones and some others, the name will display, but that's a function of the phone on the receiving end.

  • How do i block my number when i send a text on my iphone 4s

    how do i block my number when i send a text on my iphone 4s

    In the U.S. the FCC adopted anti spoofing rules applying to extend the "Truth in Caller ID" act. The specific recommendation from Congress read:
    Legislative recommendations include clarifying the scope of the Truth in Caller ID Act to include (1) persons outside the United States, (2) the use of IP-enabled voice services that are not covered under the Commission’s current definition of interconnected Voice over Internet Protocol (VoIP) service, (3) appropriate authority over third party spoofing services, and (4) SMS-based text messaging services
    It is illegal to falsify the originating number for SMS messages in the U.S. This was originally intended to target telemarketers and text message spammers. The end result, though, is that is is illegal to block your phone number when sending an SMS message. A number (or unique, tracable, identifier, in the case of some automated system) must be sent since the recipient is charged for receipt of the message.

  • How to copy/paste anchor text box to its anchor point in text and delete all empty anchors?

    hi all
    i have a document of few pages but one story. The right column is the main text box and on many places anchored text boxes are placed which appeared on the left column as shown below.
    i want text of each anchor-text-box to be cut from its place and paste at its insertion/anchor point and delete all empty anchored boxes.
    I am trying since morning but i unable to reach anchor object reference. Any help on how to start with will be helpful.
    virender

    Ok, let's say you have one main text box (not anchored) and three text boxes that are anchored to text within it. The first one is anchored with text, the second one is unanchored, and the third one is empty (I'm not going to get into inline anchoring vs. custom anchoring since you didn't bring it up in your post).
    We cycle through the items on the page:
    function main(){
      var myDoc = app.activeDocument;
      var myPages = myDoc.pages.everyItem().getElements();
      for (var i = 0; i < myPages.length; i++){
        var myPage = myPages[i];
        //Checks that the page is valid, and that it is not a master page. If either is true, skips to the next page.
        if (myPage.isValid == false) continue;
        if (myPage.parent instanceof MasterSpread) continue;
        var myItems = myPage.allPageItems;
        for (var j = 0; j < myItems.length; j++){
          //Current item.
          var myItem = myItems[j];
          //If myItem doesn't have a Character parent, it is not anchored.
          //The first and third text frames would fail this test.
          if (!(myItem.parent instanceof Character)) continue;
          //We only care about text frames.
          if (!(myItem instanceof TextFrame)) continue;
          //I think the only way this would happen would be if you had an image or
          //something else unexpected within the frame. I check for it so no content
          //is inadvertently lost.
          else if (myItem.texts.length > 1) continue;
          //If we're still in this iteration of the loop, all qualifications are met.
          //Flatten the text frame.
          //I don't use layers that often so, to me, flatten makes sense. You may want
          //to use a different term if there's a chance for confusion.
          flattenItem(myItem);
    function flattenItem(funcItem)
         //Hold onto the anchor character.
        var myParent = funcItem.parent;
         //Duplicate the text from within the frame so that it appears right after the anchor.
         //There may be other methods, but this works for me. I try to avoid copy/paste
         //so as not to deal with any clipboard mishaps. I added a check in case of empties.
         if (funcItem.texts.length > 0){funcItem.texts[0].duplicate(LocationOptions.AFTER, myParent.insertionPoints[0]);}
         //Replace the anchor character itself with a space (or whatever) which also
         //deletes the text frame it was anchoring.
        myParent.contents = " ";
    I guess the takeaway might be that you're not looking at the main text frame and then checking to see if anything is anchored to it. You're looking at each text frame and figuring out if it is anchored. That's my approach, anyway.

  • How can I fill in a default inputText in a Text Box

    How can I fill in a default inputText in a Text Box. Is it possible to create a button and then it should be possible some underlying data fill in the text boxes???
    Please help!

    My coding looks at the moment like that:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ page language="java" %>
    <html>
    <head>
    <title>
    JSF
    </title>
    </head>
    <body>
    <f:view>
    <h:form id="user">
    JSF Application View:<br><br><br>
    Credit Limit:.......
    <h:inputText value="#{User.username}"/><br>
    Currency:...........
    <h:inputText value="#{User.username}"/><br>
    Score:..............
    <h:inputText value="#{User.username}"/><br>
    Valid Date To:......
    <h:inputText value="#{User.username}"/><br><br>
    <h:commandButton value="Receive Data from Background" action="success" /><br>
    </h:form>
    </f:view>
    </body>
    </html>
    Now my question is how it is possible to fill in the inputTextvalue when I click on the Button "Receive Data from Background" Is it possible to define that in that coding above????
    Please help I'm not fit in JSF

  • Anchored text box within a text frame

    I'm struggling to find the correct anchored option to allow an anchored text box to sit under a paragraph block with a 4pt space after. What I need is to edit the paragraph above. If the copy runs onto more lines I want the box to drop down as the extra line increase (to keep in the flow).
    Also, I may need to increase the amount of copy inside the anchored text box. When I pull the depth of the anchored box down, the whole anchored box shoots up. The space after the above paragraph has lost its spacing.
    Can anyone explain the best way to anchor a box which could change in depth but keep the same spacing between each block of text?
    Thanks
    lister
    Indesign CS6
    OSX

    You have two choices, use auto for the leading on the paragraph that contains the inline/above line frame (and you can set the autoleading percentage in the Justification settings so it calculates the same value as your fixed leading for that size type if you don't want to use a different paragraph style) and ID will adjust the leading to the largest "character" in a line -- the anchored frame, or you can use a custom anchored frame and set the offsets and text wrap.
    In this case, I think the inline/above line option is preferable as it will push the anchoed frame to the next column if necessary, and it's a lot easier to set up.

  • ADF 11g + How to capture the value of a dynamically created input text box

    Hi All,
    I have a requirement where, on selection of the value in a drop down, the input text boxes need to get dynamically populated on the JSPX page. I'm able to bring this functionality, and it is working fine.
    But the challenge right now I'm facing is that, how to read/capture the value entered in those dynamic text boxes on submission of the page. Please help me in getting this resolved.
    Below is the code snippet I'm using for this.
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    RichInputText pcPreferredDomain = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks All in Advance,
    Thanks & Regards,
    Dharmathej M

    As per your method, you are creating the RichInputText components as local variables.
    What happens when you are creating them as class level variables in the managed bean, if you do so, you can refer to the values of the UI components in the actionListener/action code for the command button in the managed bean
    sample:
    public class ManagedBean{
    RichInputText [] pcPreferredDomain;
    public ManagedBean(){
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    pcPreferredDomain = new RichInputText[iIPAddress];
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    pcPreferredDomain[i] = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks,
    Navaneeth

  • How to show only date in BO webi 3.1 text box

    how to show only date in BO webi 3.1 text box for e.g:-
    01/01/2005  (no time only date)

    hi,
    just check by which format your date is coming
    just create a one variable and check =UserResponse("Transaction Date From (mm/dd/yy)")
    if your output is in format of("mm/dd/yyyy hh:mm:ss a")
    then some format we have to write in todate syntax
    then your final formula for date would be
    =FormatDate(ToDate(UserResponse("Transaction Date From (mm/dd/yy)");"mm/dd/yyyy hh:mm:ss A");"dd/mm/yyyy")

  • How to use a radio button in enabling/disabling a text box in report progra

    Hi,
        Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.

    *& Report  ZMR_RADIO_BUTTONS
    REPORT  ZMR_RADIO_BUTTONS.
    PARAMETERS : R1  RADIOBUTTON GROUP G1,
                 R2  RADIOBUTTON GROUP G1.
    PARAMETERS : A1 TYPE I,
                 A2 TYPE I.
    AT SELECTION-SCREEN OUTPUT.
    *initialization.
    IF R1 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF R2 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    modify screen.
    ENDLOOP.
    ENDIF.
    START-OF-SELECTION.
    *IF R1 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 1.
    ENDIF.
    *ENDLOOP.
    *ENDIF.
    *IF R2 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 0.
    ENDIF.
    *ENDLOOP.
    *ENDIF.

  • How can I click on a button and make a text box appear or disappear

    How can I click on a button and make a text box appear or disappear?
    Thanks ahead of time for your help,
    Doug

    Hi Denes,
    I just thought that the example you pointed the OP to, is far more complex than what I understood he needs. The OP was talking about using a button, which I thought was a very basic and simple case. Your example is much more complicated. If memory serves, the radio group item, at the time (prior to 3.1 fieldset) behaved differently, so you needed to create a new value retrieving function, and then was the need to preserve the items show/hide status upon reloading the page. In short, I thought maybe I didn’t see the complexity in the OP post, but it seems that his requirement was indeed a simple one.
    Regards,
    Arie.

  • How do i change the number of columns within a text box?  I need to go from three columns to one.

    How do I change the number of columns within a text box?  I need to go from 3 columns to 1.  The insert column is highlighted and column break does not work for this.

    Pages '09 does not seem to allow layout breaks in Textboxes.
    Pages 5.2 has the same limitation.
    Use multiple linked Textboxes in Pages '09 to get the layout you want or create your layout in a Word Processing template in the document layer.
    Peter

  • How do you change the font color in CALL-OUT text boxes in PRO XI?

    How do you change the font color in CALL-OUT text boxes in PRO XI?

    It's not so simple to find it if you don't know what you're looking for... But it can be found via View - Show/Hide - Toolbar Items - Properties Bar.

  • Since moving to Maverick and the new updated of Keynote, I have a constant problem when typing in a text box, the program crashes. Is there a bug fix for this. Drives me nuts.

    Since moving to Maverick and the new updated of Keynote, I have a constant problem when typing in a text box, the program crashes. Is there a bug fix for this. Drives me nuts. Like many who can type quite quickly but at secretarial level, the text box freezes, nothing works and you know what's coming...crash!
    This is most annoying. Is there bug fixes for this. Apparently I have the current updates and this problem still exists. Is it a Maverick bug or Keynote.
    Barry

    How did you install Mavericks, as an update ontop of the previous OS or did you wipe the drive and install clean?

  • Font change when I make a text box transparent

    Hi All
    I have been using Captivate 4 for over a year and have just come across a strange event.
    When I change a text box caption type from a coloured background, such as adobe blue, adobe pop up etc, to transparent, the font type and style change from what I originally had and I am unable to change it back.
    For example I am using Verdana 12 black in adobe blue caption. When I change this to transparent the font style changes to something else, even though the application still says the font is Verdana 12 black. It is very obvious it is a different font to Verdana as the other text on the slide that has not been changed to transparent looks very different to the transparent text box font.
    This font looks nothing like Verdana as it is smaller and thicker; it resembles Arial Black though it is not quite that either.
    This change occurs when I am using a text box on its own or a text box associated with a roll over slidelet.
    Does anyone have any idea what is happening, and should I post this in bug fixes?
    cheers
    thedarf

    Hi there
    In addition to Lilybiri's advice, you can also typically achieve the desired effect by editing the Text Caption and positioning the cursor at the end of all text. Just press Ctrl+End to do this. Then press Enter a couple of times to introduce a couple of blank lines. Then format the last line as bulleted. After that, adjust the size of the caption so you don't see the bulleted blank line.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • How do I make a box that resizes based on the amount of content that resides in a text box above it?

    I have a box that I want to use as a background to a text field on several pages. I want that box to be able to automatically resize itself based on how much content is in the text box that sits above it. How do I accomplish this?

    Hello,
    Please refer to forum post : http://forums.adobe.com/message/4828489#4828489
    Regards,
    Sachin

Maybe you are looking for

  • Unable to assign the dimensions to the Applications

    Dear Experts, While i am assigning the Dimensions to the Consolidation Application i am getting the following error "THE FOLLOWING DIMENSIONS ARE SET AS CONCURRENT LOCK DIMENSIONS.[CATEGORY][P_CC] GO TO [CONCURRENT LOCK MENU] TO CONTINUE." Can you pl

  • Possible.. or impossible?

    is it possible to have Java edit/create a text document in a specific folder? and if the folder doesnt exist also create the folder? If you know how to do this please hook me up with some info :)

  • Functions for multi-phase catalog access, with retries...

    See Catalog:action & Catalog:privateAction below. These functions support iterative catalog access, to divide catalog updates into chunks... Also, they support retries to deal with contention in case another plugin task is already accessing the catal

  • Product category replication

    Hi Guys, I want to replicate the product category from ECC to the SRM system, can you please tell me the steps to do this? Also is it possible to have both the long and short description from material group in ECC to SRM system? Thanks in advance. Re

  • Playlist is doubled .... each list item is listed twice

    12.1.0.5.0 iTunes  up to date All the items in my playlist listings are doubled: Diana Krall and Diana Krall 1  Dave Matthews and Dave Matthews 1  etc.  Does this have something to do with the cloud or a setting. I delete the doubled item (followed b