Highlight Text using JSObject

I have a requirement which says to compare 2 PDF files and highlight the differences by adding an image at the text position. I am using JSObject to read the text (word by word) from both PDF's.
1. Is there any way to find the text position (X/Y co-ordinates)?
If i get the position of the text, I can use PDF Stamper to attach an image at the location.
Any ideas??

> Thats fine. This means I have to change setting for Plug-ins.
I don't think you quite understand. You're not changing a setting in a plug-in that will make JavaScript return the special characters. What they're saying is that it is not possible in JavaScript, and you will have to create your own plug-in to add this functionality, from scratch, in C/C++ (the only languages available to a plug-in).

Similar Messages

  • Highlight text using conditional text

    Hi,
         I need to highlight text using conditional text in InDesign.  I can highlight text using the below code.
    var myDoc = app.activeDocument;
    colorToHighlig = myDoc.conditions.add ({name:"Yellow",indicatorMethod:ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor:UIColors.YELLOW});
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.changeGrepPreferences.appliedConditions = [colorToHighlig] ;
    app.findGrepPreferences.findWhat = "chapter";
    myDoc.changeGrep();
    But I need to set Indicator to "Show and Print" coz while generation pdf with indicator mode "show", highlights are missing in PDF.  I can retain those highlights with the indicator mode "Show and Print". Dono how to set it..
    If anyone know, pls help me.
    Thanks in advance,
    Sudha K

    Hi,
    it seems, that this one is not a property of the condition, it is a preference:
    myDoc.conditionalTextPreferences.showConditionIndicators = ConditionIndicatorMode.SHOW_AND_PRINT_INDICATORS;

  • Highlight Text using X/Y co-ordinates

    I am developing a PDF application using VB.NET. I need to highlight a PDF document using X/Y co-ordinates.
    I get the co-ordinates which define a rectangle like this -
    ?oCoord(0)
    {System.Array}
    (0): 36.0 {Double}
    (1): 799.1719970703125 {Double}
    (2): 39.33599853515625 {Double}
    (3): 799.1719970703125 {Double}
    (4): 36.0 {Double}
    (5): 785.30010986328125 {Double}
    (6): 39.33599853515625 {Double}
    (7): 785.30010986328125 {Double}
    The co-ordinates are fetched using the following method,
    oCoord = JSO.getPageNthWordQuads(Page, Word)
    How do I shade the PDF using the above co-ordinates?

    Thanks Leonard. The highlight option is the one I was looking for.
    When I tested with simple X-Y co-ordinates it works great. But when I give using the co-ordinates what I get from the exact location (i.e., I get 8 values which describe a rectangle), I get the following error,
    "Value does not fall within the expected range."
    Here is the failed code -
    page = pdDoc.AcquirePage(0)
    '' I get pageRect.Y = 842 and pageRect.X = 595
    pageRect = page.GetSize
    popupRect(0) = 36D
    popupRect(1) = 673.171997070312D
    popupRect(2) = 96.69580078125D
    popupRect(3) = 673.171997070312D
    popupRect(4) = 36D
    popupRect(5) = 659.300109863281D
    popupRect(6) = 96.69580078125D
    popupRect(7) = 659.300109863281D
    annot = jso.AddAnnot
    props = annot.getProps
    props.Type = "Highlight"
    annot.setProps(props)
    props = annot.getProps
    props.page = 0
    props.popupRect = popupRect
    props.strokeColor = jso.Color.Yellow
    annot.setProps(props)
    What is that I am missing? Or do I need to do some manipulation with the co-ordinates.
    Here is the code which works fine -
    page = pdDoc.AcquirePage(0)
    '' I get pageRect.Y = 842 and pageRect.X = 595
    pageRect = page.GetSize
    popupRect(0) = 0
    popupRect(1) = pageRect.y
    popupRect(2) = 200
    popupRect(3) = pageRect.y
    annot = jso.AddAnnot
    props = annot.getProps
    props.Type = "Highlight"
    annot.setProps(props)
    props = annot.getProps
    props.page = 0
    props.popupRect = popupRect
    props.strokeColor = jso.Color.Yellow
    annot.setProps(props)

  • Highlighting Text in pdf Documents using Preview

    Am using Snow Leopard (10.6.3) with Preview version 5.0.2.
    Tried highlighting text using the instructions in Preview help. No success.
    I click Annotate; chose the Highlight Colour but then appear to be unable to select the text.
    Anyone any ideas?
    Thanks

    Thanks for the hint. I think I've just discovered why I cannot do it. The pdf document I'm trying to highlight is the result of the output from a scanner. Hence it is effectively a "picture" - not text. The only thing that I have been able to do is to choose Annotate and then choose "Add Oval" or whatever and select its size and colour and then position this over the text I wish to highlight.
    Because it is effectively a picture you cannot select text. I tried it on another pdf document that IS text and your solution works a treat.
    Thanks again
    Malcolm

  • Highlighting text in Reader

    When highlighting text using the highlighting tool, Reader is highlighting a block instead of a row of text.  How do I correct this?

    Hi Pat
    Nope not an image - but I'll tell you, when checking the document's properties, I again tried the highlight function and without amending anything to the document or the application; it now highlights correctly ... very odd

  • How do you highlight text in Pages v5?

    Hi guys,
    Was struggling a bit with the recent changes from Pages 5 and was wondering how we could highlight text (using different colours etc)?
    Thanks !

    Your question is answered in the following post:
    https://discussions.apple.com/message/23519269#23519269

  • I updated my 4s to ios7 and now when I highlight text their is no cut option

    I updated my 4s to ios7 and now when I highlight text their is no cut option?

    To delete highlighted text, use the Delete (Backspace) button on the keyboard.

  • Changing highlight text color / using Highlighters

    I've subclassed JTextArea, and among other things, am trying to add the functionality for drawing the active selection even when the TextArea doesn't have focus. I've overridden processFocusEvent like so:
    public void processFocusEvent(FocusEvent e){
            Highlighter h = this.getHighlighter();
             if (e.getID() == e.FOCUS_GAINED){
                //remove the inactive highlight
                h.removeAllHighlights();
            //this will put the selection highlight back in for us, among other things,
            //if we just gained focus.
            super.processFocusEvent(e);
            //now add the inactive-selection highlight if we just lost focus
            if (e.getID() == e.FOCUS_LOST){
                try {
                    h.addHighlight(
                            this.getSelectionStart(),
                            this.getSelectionEnd(),
                            new DefaultHighlighter.DefaultHighlightPainter(
                                new Color(212,212,212)
                } catch (Exception ex){
                    ex.printStackTrace();
        }and it works quite nicely. Notice that I draw the inactive selection gray.
    There's a slight problem with this: JTextArea doesn't treat the text in the highlighted section any differently, as opposed to how it would when the component is focused (i.e. rendering it in the highlighted text color). I'm guessing this is because it knows that it's not focused, and therefore assumes that there's no highlighting to be drawn. So as a result, all text in the text area is rendered in the same color --- the foreground color --- when the textArea doesn't have focus, regardless of what is being highlighted. For this reason, setSelectedTextColor() has no effect.
    But I want to be able to change the highlighted text color, since, in theory, the user's system could be configured to show text in the exact same gray that I'm highlighting with. I want to just be able to set it to be white or black.
    I am rather averse to using a TextPane, since what I'm writing is designed to edit plain text, and a TextArea has many wheels that I don't want to reinvent, like setTabSize(), for example.
    Clearly, there is code already in place somewhere to draw text a different color for highlighted portions of a TextArea. Is there some way I could perhaps trick only the drawing code into thinking that it has focus? What is the cleanest way to accomplish what I want, i.e. the way that involves rewriting the least amount of functionality?
    Any suggestions/leads would be greatly appreciated.

    Here's a better way to keep the selection visible. All those hard-coded colors are a big no-no, but this is just to demonstrate the technique.
    import java.awt.Color;
    import javax.swing.text.DefaultCaret;
    import javax.swing.text.Highlighter;
    import javax.swing.text.DefaultHighlighter;
    * usage:
    * textComponent.setCaret(new GhostCaret());
    public class GhostCaret extends DefaultCaret
      private static final Highlighter.HighlightPainter unfocusedPainter =
          new DefaultHighlighter.DefaultHighlightPainter(new Color(230, 230, 210));
      private boolean isFocused;
      protected Highlighter.HighlightPainter getSelectionPainter()
        return isFocused ? SimpleHighlighter.defaultPainter : unfocusedPainter;
      public void setSelectionVisible(boolean hasFocus)
        if (hasFocus != isFocused)
          isFocused = hasFocus;
          super.setSelectionVisible(false);
          super.setSelectionVisible(true);
          getComponent().setSelectedTextColor(isFocused ? Color.WHITE : Color.BLACK);
    }

  • I cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    i cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    Chester31,
    Thank you very much for sharing your file with us!  Now that we are able to reproduce the problem at our end, you may stop sharing the file on Acrobat.com.
    Do you know when this problem (for not being able to add new highlight/strikeout/underline) has started?  Did you update your iOS from 7.x to 8.0 recently?
    We will continue investigating the problem and let you know what we find.
    Thank you again for your help.

  • Highlighting results using oracle text

    Hi
    I've hooked up to Oracle text using odp.net and can query that fine. Now I would like to use the highlighting feature of OT but I'm having problems finding suitable examples of how to do it.
    I've read through a number of Oracle Text documents, they say use CTX_DOC package to hightlight the result but that's PL/SQL. How can I do it with odp.net ?
    thanks

    Ok thanks for that - I've done that and its cleared the error but I'm still finding more problems
    i've tweaked my code some more as the one and currently have this
              setType();
              OracleConnection oConn= dbConnect();
              //setType();
              oConn.Open();
              OracleCommand oCmd = new OracleCommand();
              oCmd.CommandText = "ctx_doc.Highlight";
              oCmd.Connection = oConn;
              oCmd.CommandType=CommandType.StoredProcedure;
              //params     
    OracleParameter oparam2 = oCmd.Parameters.Add("index_name", OracleDbType.Varchar2);
    oparam2.Direction = ParameterDirection.Input;     
    oparam2.Value = "description_idx";
         OracleParameter oparam3 = oCmd.Parameters.Add("textkey", OracleDbType.Varchar2);
    oparam3.Direction = ParameterDirection.Input;     
    oparam3.Value = "ID";
         OracleParameter oparam4 = oCmd.Parameters.Add("text_query", OracleDbType.Varchar2);
    oparam4.Direction = ParameterDirection.Input;     
    oparam4.Value = "test || hello";
    OracleParameter oparam = oCmd.Parameters.Add("restab", OracleDbType.Varchar2);
         oparam.Value = "ctx_hitab";
    oparam.Direction = ParameterDirection.Input;
         OracleParameter oparam5 = oCmd.Parameters.Add("plaintext", OracleDbType.Int32);
    oparam5.Direction = ParameterDirection.Input;     
    oparam5.Value = false;
              OracleDataAdapter da = new OracleDataAdapter(oCmd);
              DataSet ds = new DataSet();
              da.Fill(ds,"TEST");
              //oCmd.ExecuteNonQuery();
              oConn.Close();
    and it's producing this error which obviously relates to parameter 3 but I'm not sure how I can correct it.
    ORA-20000: Oracle Text error: DRG-11445: rowid value is invalid: ID ORA-06512:
    at "CTXSYS.DRUE", line 157 ORA-06512: at "CTXSYS.CTX_DOC", line 876 ORA-06512: at
    line 1
    many thanks

  • Is it possible to add highlighted text in an iBooks interactive textbook using VoiceOver?

    Is it possible to add highlighted text in an iBooks interactive textbook using VoiceOver?

    The only way you can add read aloud to an ibook is by using easy epub code editor. (Go to itunes and look it up). This app works on the ipad and is the ONLY app that can generate smil/xml code for read aloud. The only thing is that you cannot use it on anything but a raw epub file. You cannot use it with ibooks author or with any other file. Hope this helps.

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • Can you make a menu for the right-click search so that when I highlight text and search, I can choose which search engine to use?

    If you Highlight text you can right-click on it to pull up a short menu. One option is "Search x search engine for 'highlighted text'" Previously, the search engine selected would be whichever search engine was selected on the search bar, so Google or Amazon.com, etc. Because you can no longer change that selection before you search, the search engine is set to your default. Was an annoyance before, but now it's just a hindrance.

    Strongly recommend Context Search extension which will solve your problem
    - https://addons.mozilla.org/en-US/firefox/addon/context-search/?src=search

  • Highlighting Text & Auto Text Options

    I've recently migrated from MS Word to Pages, and I'm determined to make this new relationship work. In Word I used its highlighting text (as with a real highlighter--yellow, pink, etc.) feature, as well as its Auto Text feature, in which I had a number of prescribed, hyperlinked comments. (I'm a teacher, and I would auto text things like, "comma error," which would then be linked to a web page about comma errors.
    Can anyone help me discover ways to do both of these in Pages? Also, is there anything for Pages like MS Word's macros?
    Thanks in advance,
    Brad Carpenter

    Welcome to the forums, Brad.
    There is no direct analogue in Pages to Word's highlighting feature. However, you can use the Comments feature to add specific comments to a specific piece of text (with the advantage that the comments can be easily hidden, since you are not changing the characteristics of the actual text). Simply select a bit of text and click the Comment icon in the toolbar, or from the Insert menu select "Comment". The selected text will highlight in document, and a comments box will appear to the left of the page, in which you can type whatever you want. In the comments box you can select whatever text you want and make it a hyperlink, by going to the Hyperlink Inspector. Unfortunately, there is not an easy way to automate the creation of a hyperlink, at least as far as I know.
    There are plenty of third-party applications that will let you store and add snippets of text easily to any Mac document, including Pages. These include TypeIt4Me, Butler, and even Quicksilver, which has a fanatical following and may be more than you need for this kind of task. I'm sure others here might be able to suggest other apps.
    One caution, however: If you intend to be sharing documents with others, they must be using Pages themselves to take advantage of these features. Unless your students are also using Pages, these workarounds won't really help.

  • Highlighting text in  Preview

    Unexpectedly, a strange alteration to how I can highlight text,  when reading a pdf in Preview has occurred. I used to be able to check the highlight icon in the annotations bar and that's about it. Now when I intend to highlight text, the colour extends to being four lines wide, and when I finish - it gets even stranger. Instead of  the text with a straight band of colour - like with a real high-liner pen - odd shapes occur across the text! How to revert to a simple, colour line highlighting the text I feel is important?

    No it has nothing to do with, if the PDF is protected or not. It is not in this case, it is having the PDF open in Preview and holding down the mouse button and dragging and highlighting the information in whatever direction you push your mouse in. Preview seems to only highlight what ever is showing on the screen instead of highlighting from page to page.

Maybe you are looking for

  • Can not find Function module in Crystal Report Database Connections FN

    Hi, we designed a Function Module XX in SE80. We set up BO Interagtion for SAP We can connect to the R3( CRM) System. We can See FN's. We can not see our Function Module XX we designed in SE80 in the Database Connection What is missing ? Any Authoriz

  • Mail Server Relay Authentication Failure in Server Admin

    I need to set up Mail Server to relay through my ISP.  I know that I can authenticate to smtp.comcast.net:587 using my account and TLS usnig a mail client. However, when I use Server Admin to configure my server's SMTP to send all outgoing email thro

  • Renderer a document  with Windows Explorer

    Is it possible to renderer a document when I open this document with MS Word by using the windows interface. In fact, I open the document from windows explorer where I see Oracxle iFS server like a drive. With the web interface, I renderer the docume

  • Horizontal scrolling with mouse wheel?

    I have built a website for a client that scrolls only horizontally. Is it possible to scroll with the mouse wheel horizontally? Is there certain HTML I need to add? Thank you

  • Please Wait....... Problem

    Dear members, I am a very simple question but creating me a big problem. I need to send Mails to 10,000 peoples at same time retriving the email address of each from database. Theres no problem in sending mails. The main thing is, When i click on SUB