How to detect overflowed text?

Hello,
I'd like to programatically detect overflowed text (ie. text which is not visible in its entirety). In reference guide I found that it should work be obtaining FP_Overflowed property of FO_SubCol, but it doesn't work for me. Here's sample document:
http://twoflower.matfyz.cz/inc/overflow_text.fm
How can I detect it properly?
Thank you.

Hi Stanislav...
I've used the following code to detect an overflow ..
F_ObjHandleT pageId = F_ApiGetId(FV_SessionId, docId, FP_FirstBodyPageInDoc);
while (pageId) {
F_ObjHandleT pageFrameId = F_ApiGetId(docId, pageId, FP_PageFrame);
F_ObjHandleT frameId = F_ApiGetId(docId, pageFrameId, FP_FirstGraphicInFrame);
F_ObjHandleT subcolId = F_ApiGetId(docId, frameId, FP_LastSubCol);
F_Printf(NULL, "pageFrameId %d; frameId %d; subcolId %d\n", pageFrameId, frameId, subcolId);
if (F_ApiGetInt(docId, subcolId, FP_Overflowed) == True) {
// do something
pageId = F_ApiGetId(docId, pageId, FP_PageNext);
When I run this on your file, it appears that your small overflowed textframe has no subcols, thus no place to check for the FP_Overflowed property. I'm not sure exactly why there would be no subcols (an Esc,g,o shows that it has one column .. ??).
Good luck,
...scott

Similar Messages

  • How can detect certain text (String) was input in a JTextArea?

    Hi friends,
    while trying to simulate a telnet shell, i create a JTextArea and put all the input and output text (from telnet) in it. I want to do some info updating in another JPanel when user logs in. Hence I need to detect if user correct logged in, say, a prompt will appear in JTextArea, such as :
    [remote host]>
    I need here a Listener for detecting, could someone tell me how i can do it, or which Class or Interface or Methods i should use? Many thanks in advance!!!
    eedych

    I found something that I hope helps:
    The java.awt.TextArea could be monitored for changes by adding a TextListener for TextEvent's. In the JTextComponent based components, changes are broadcasted from the model via a DocumentEvent to DocumentListeners. The DocumentEvent gives the location of the change and the kind of change if desired.
    Example code :
    DocumentListener myListener = ??;
    JTextArea myArea = ??;
    myArea.getDocument().addDocumentListener(myListener);
    Just use the DocumentListener like any other listener. :) Good luck.

  • How to detect if text has been clipped in a JRadioButton ?

    Hi,
    Is there any way to test if the text in a JRadioButton (same holds e.g. for a JCheckBox) has been clipped and contains ellipses ... at the end. For a JLabel, knowing the FontMetrics one can use SwingUtilities.computeStringWidth(). I found the method SwingUtilities.layoutCompoundLabel() but it needs to know also the icon, which is not available by getIcon(), if not explicitly set with setIcon() in the JRadioButton.
    So, is there any way to get info about the default icon used by the current UI in a JRadioButton or JCheckBox ?
    Or better, is there any convenience method I've overseen which may lead to the goal.
    Background info:
    The text for the JRadioButtons (or JCheckBoxes) are read from a database and Tooltips should only be generated, when clipping occured, as a popup with the same text as in the base component doesn't provide so much new information.
    Thanks for your help
    ThomasGrewe

    Hi,
    your problem could be have a solution when you use a right layout manager. You have to use a layout manager wich use the preferredSize from the objects.
    I tryed this code and work, with a BoxLayout. I dont understand yor Problem, maybe you have to write your code here (if it is not too long ;) )
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.Border;
    public class Test extends JFrame{
      private String[] text;
      private int index = 0;
      private MyRadioButton rb;
      public Test(){
        text = new String[]{"Loooooooooooooooong", "mittttel", "Small", "1"};
        JButton changeText = new JButton("Change Text");
        rb = new MyRadioButton("Radio Button");
        changeText.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
            if(index >= text.length)
              index = 0;
            rb.setText(text[index++]);
            rb.invalidate();
        getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
        getContentPane().add(changeText);
        getContentPane().add(rb);
      public static void main(String args[]){
        Test f = new Test();
        f.setSize(100,100);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    class MyRadioButton extends JRadioButton{
      public MyRadioButton(String text) {
        super(text);
      // your business methods...
      // set preferred, min, max size
      public Dimension getPreferredSize(){
        // let the UI compute the preferredSize
        return getUI().getPreferredSize(this);
      public Dimension getMinimumSize(){
        return getPreferredSize();
      public Dimension getMaximumSize(){
        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
    }

  • [JS][CC] How can I get the last visible character in an overflowed Text Frame?

    Hello
    I'm new in InDesign scripting in javascript. I would like to know if there is a way to get the position of the last character in a Text Frame that is overflowed? I need this because I want to calculate how many characters are hidden (overflowing text) via script.
    I've searched in the forums about this but what I find is always a script for alerting if there's overset text or not.
    I'd really appreciate any help!

    Well, let's say that myFrame is an overflowing text frame.
    So, the last character in that frame would be
    myFrame.characters[-1];
    To calculate the number of overflowing characters, select the
    overflowing text frame, and run this script:
    myFrame = app.selection[0];
    myParentStory = myFrame.parentStory;
    alert("Number of overflowing characters is
    "+myParentStory.characters.itemByRange(myFrame.characters[-1],
    myParentStory.characters[-1]).length-1);
    Ariel

  • Who knows how to output some text once labview detects something I want using pattern matching(V​ision assistant)​?

    who knows how to output some text once labview detects something I want using pattern matching(Vision assistant)?
    The text is something like"Yes, this is a coin"
    Thanks!

    I attached a SubVI which I used to place an overlay next to a Pattern, found by a Pattern Match before:
    As you can see, you simply pass the image reference and the Array of Matches to the VI along with the String you want to have as an overlay next to the Match.
    I also modified your VI a bit, but didn't test it. I created an Array of clusters, each elment containing the template path along with the respective text.
    Please note that this is just a hint!
    Christian
    Attachments:
    suggestion.vi ‏146 KB
    Overlay_Txt.vi ‏24 KB

  • How to get the result of auto detecting of text-encoding in HTML component.

    Hello.
    I just run in to the wall.
    I've hard that a HTML component automatcally detect the text-encoding of a HTML page loaded,
    and it supposed to be detected through Binary data of its HTML source code.
    I wonder, if there is any variable or function to get the detected text-encoding like UTF-8, iso-8859-1 or something like that.
    I'm glad for any response.
    thanks.

    There is TEXT_IO package in forms. For more help use the Oracle Form specific forum.

  • How to re-size a overflow text frame based on the text length?

    Hi ..
    Is it possible to re-size a overflow text frame based on the text length?

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

  • Detecting/Correcting text overflow

    Hi folks,
    Has anyone here ever been able to successfully determine if a TextItem in PS has overflow in it? Basically I am trying to write a script that replaces text in a document. If this in turn causes text overflow I would like the script to reduce the point size. I have done a few exeriments with both point and paragraph text.
    There seems to be no obvious methods or properties for determining that overflow occurs. I thought I could cheat and measure the widths and heights of the text items before I replace the text, then check to see if they are different afterwards and if so, reduce the point size.
    However in the case of point text it is not possible to determine the text width so I would have to do something like rasterize it then do the measurement. In the case of paragraph text the height and width of the text box do not change if there is overflow.
    Does anyone have any better, more efficient ideas?
    cheers
    Ben

    Many thanks Paul, that method works fine for point text.
    As for paragraph text I think I have come up with a solution.
    If we convert a paragraph text layer into a point text layer by doing something like:
    ArtLayer.textItem.kind = TextType.POINTTEXT;
    and overflow has occured, photoshop will clip out the overflowed text.
    So after converting the paragraph to point text we need only check that our
    text contents matches the text we are trying to replace it with.
    These solutions are a both work arounds, it would be nice if there was a proper
    method or property to deal with this. Maybe I will make a dear adobe entry.

  • What's the best way to detect that text fits into ContainerControllers without scrolling?

    Hi.
    Question
    What's the best way to detect that text typed by user (or added programmatically) exceeds available container space and find out where starts truncated part? Is there available some other (than described bellow) easy way to detect it or disallow set of controllers to receive more characters that can be displayed in given composition area?
    My partialy failed attempt (simplified)
    For example lets say that I've got an editable textflow with attached two instances of ContainerController.
    var flow:TextFlow = createSomeFlowFromGivenString(sampleText),
        firstController = new ContainerController(firstSprite, 100, 30),
        lastController = new ContainerController(secondSprite, 600, 30);
    flow.interactionManager = new EditManager(new UndoManager());
    flow.flowComposer.addController(firstController);
    flow.flowComposer.addController(lastController);
    flow.flowComposer.updateAllControllers();
    With enabled vertical scroll policy I can compare height of the composition in last controller with height of the content:
    var bounds:Rectangle = lastController.getContentBounds(),
        overflow:Boolean =  lastController.compositionHeight < bounds.height;
    trace('Content does not fit into given area?', overflow)
    But when I switch vertical scroll policy off (lastController.verticalScrollPolicy = ScrollPolicy.OFF) - unfortunately this no longer works...(In my case scrolling should be dissabled, since text areas might have only one line with restricted width)
    Use case
    I want to create fillable form. Field might have a single or multiple lines. One field might start in the middle of the page, continue in the next line where it spreads through whole page and end in the - quarter of page width long  - third line. Text typed by the user can't exceed given area since it might cover some static text that sits right after/below field.
    Something like ascii image bellow:
    |                <PAGE>                    |
    |                                          |
    |                                          |
    |                                          |
    |               [Field starts here........ | 
    | ........................................ |
    | ........................................ |
    | Ends here..]                             |
    |                                          |
    |                                          |
    | [Another field] xxxx  xxxx xxxxxxxx x xx |
    | xxxxxxxxxxxxxxxxxxx                      |
    |                                          |
    |                              [One more.. |
    | .....]                                   |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    Info:
    [......]  <-- form fields starts with '[' character, and ends with ']'
    xxx       <-- sample, static text
    | and _   <-- page borders

    I've tried something like that previously, but it didn't work because then I've got vertical scroll policy to set to 'auto'. After changing verticalScrollPolicy to ScrollPolicy.OFF  in the last container it worked like a charm.
    Thanks zhen bian

  • Find overflow Text

    Hi every one
    is there a script that help to find the text boxes with overflow text (like in indesign with overset text)

    Here is how to select the text frame.
    textFrame.GraphicIsSelected = 1;
    You can go to the page by using something like this with FrameScript:
    Set doc.CurrentPage = textFrame.Page;
    Unfortunately, ExtendScript doesn't have this .Page shortcut, so you will have to figure out how to navigate from the textFrame object to the Page object. If your text frames are always in an anchored frame directly inside the main text flow, then it is pretty straightforward. However, you may want to make a general purpose function where you can find the Page object for any FrameMaker object, regardless of where it is on the page. You should pose this as a separate discussion on the list. If I have time, I will try to work out the code for you.
    Rick

  • How to detect system date Format?

    Could some one help to find out how to detect local system is in MM/DD/YYYY or DD/MM/YYYY format?
    Thanks.

    What happens when you run this code in a country where the default format is yyyy-MM-dd?
    My advice is to either use the deault format for a given locale, or allow your app to be configured with a format.
    demo:
    import java.text.*;
    import java.util.*;
    public class RingingTheFormats {
        public static void main(String[] args) {
            Date now = new Date();
            for(Locale locale: Locale.getAvailableLocales()) {
                DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT, locale);
                System.out.format("%20s %s%n", fmt.format(now), locale.getDisplayName());
    }What's going on in the Japanese format? What is H21?
    edit: [Heisei |http://en.wikipedia.org/wiki/Heisei] period. nvm.

  • Overflow text on to second text field.

    My form contains a long descriptive text followed by a short line, the for text field. The next form text field is a long blank line onto which I want the overflow text from the above field to be placed. How can I do this whith Acrobat 8 Mac OSX 10.4
    Thank you

    Ah ok, you are probably not in the right forum then. This one is for XFA-based forms built with Designer (accessed through Forms->Start Form Wizard, Create a PDF Form from scratch) and not the in-built Acrobat Form->Add Or Edit Fields. I dont think the in-built fields have the funtionality you are looking for but you can ask in http://forums.adobe.com/community/acrobat/forms

  • How can detect and remove scanned white pages in an OCRd pdf file?

    How can detect and remove scanned white pages in an OCRd pdf file?

    Acrobat does not support an automated way of doing this directly. You can
    remove completely blank pages (pages that don't have any "marking
    objects"), but a scanned page does contain an image, so Acrobat won't help
    you here. There are a number of 3rd party applications and plug-ins
    available. Try a Google search for
    remove blank pages from scanned
    pdf<http://www.google.com/search?client=safari&rls=en&q=removeblankpagesfromscanned+pdf&ie=UTF-8&oe=UTF-8>
    This will bring up a few different solutions.
    Another way is to use JavaScript to find text. You say that these documents
    are OCRed, so if you have a blank page, it should not have any text on it.
    With some JavaScript, you can identify pages that don't contain text. This
    may however fail if you have a page that contains just e.g. a photographic
    image. There won't be any text, but the page is certainly not blank.
    Karl Heinz Kremer
    [signature removed by host]

  • Detecting white text knockout

    Hi all!
    I have a question for you. I want to detect white text that doesn't knock out. I already detect overprinting when the text is black, and less then 12px.
    Now I think by detecting white text, with OPM set to 1 and OP set to true, that's knockout, right?
    The thing is, I have an PDF here that's fully GWG 1.3 certiefied, but I still detect that there is white text that doesn't knockout.
    Is there an way to detect if an ExtGState is used or not? Because, if I'm searching an ExtGState that isn't used.... That's just pointless...
    Can someone help me?

    Sorry about that. I'm currently working on an in houde developed API, that parses an PDF. I think now were're checking for knock out to soon in the procces... How can we check if I have read all ExtGStates (and set them active if that must be done...) that there's knock out? op = true, and OPM is 1?
    Of course we check fist if the text color is 0 0 0 0....

  • How to detect avilable devices in a n/w

    hello,
    for me, I try to show the avilable devices in a network when I intially startup the system.
    Like some NMS systems, it shows all avilable devices in a network by graphically.
    how to detect and show the devices?
    thank you.

    Hi friend,
    Just use Sel.ShapeRange.Count instead.
    On the other hand, to get selected text, we could use Sel.Text, to get whole selected
    TextBox’s text, we could use Sel.ShapeRange.TextFrame.TextRange.Text.
    Good job!
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for