How use mouse draw a text select area on a PDF?

Hi All,
I am developing a small vb.net program to allow user select a area on PDF and extract the text.
I know some code below can extract text
RectAry.Left = 0
RectAry.right = rect.x
RectAry.bottom = 630
RectAry.Top = 703
txt = gPDDoc.CreateTextSelect(lngPage, RectAry)
My problem is how to know those four position value by looking at PDF.
Advanced achivement is how to let customer draw a box on that demanding area and my program pickup those four values.
If you could give me a code snippet, I am really appricate your time.
thank you

Thanks, Leonard. I am following your instrcution and making progress now.
But I had another small issue. It is regarding the coordinate value.
I tried to use arobat's "CORP" function to get the top, bottom, left, right (Because this is the only way I know to get coordinate values). Then set into select rectange parameters. I found if I put the CORP to close the text, the select rectange cannot get the text from the area.
But my CORP area is definitely include all texts and still leave a small margin to the word. If i want to get the text, I have to change the parameters a little bit and enlarge the area by a few points. Then It works.
I want to know if Acrobat SDK require a minmum margin to selected text?

Similar Messages

  • How can I restore the text selection highlight colour to the default black colour in indesign CC ?

    How can I restore the text selection highlight colour to the default black colour in indesign CC ?

    Manish Shama, thanks for your speedy response. I was able to get into my MAC settings and change the background from the black to whatever color I like, so that helps (THANKS!). But the real issue is that the selected text does not turn white (even though that's what's specified in my MAC settings), it remains black. I really want to have the selection reverse out as it always has for years and years going all the way back to PageMaker Any ideas?

  • Print only cursor-selected area of a PDF in Acrobat Pro, just as it is psbl to do in a browser

    Hi
    I want to print only cursor-selected area of a PDF in Acrobat Pro. That could be both text and images, which are in my selection. Just as it is psbl to do in a browser. Is it possible in Acrobat PRO?
    I am using the latest Acrobat Pro 11.0.9

    Thanks for your effort but this again clearly does NOT answer my question. I do see a particular problem and that is that I might want to select text and images over a range of multiple pages. In a doc of 20 pages I might want to make a single selection of the text starting PRECISELY at the MIDDLE of page 2 and then continue dragging my selection all the way to PRECISELY the MIDDLE of page 15, thereby selecting all text and images within the precise range of my selection. That is some 13 pages there and I want to print out ONLY THAT selection of text and images. And in that case I cannot use your suggestion with the marquee zoom. Do you get me?

  • Images present in datagridview not exporting to file only text contents are generating into PDF file..

    Hi Everyone,
       I have created simple Desktop app in that I trying to generate PDF file from Datagridview...when I click on ExportPDf button Pdf file is generation successfully but the issue is in that pdf whatever the images has present in datagridview that images
    are not generation into PDF only the text contents are Present in PDF file.
      Does any one can tell me how to generate the PDF file along with images.
    Here is my code:
      private void btnexportPDF_Click(object sender, EventArgs e)
                int ApplicationNameSize = 15;
                int datesize = 12;
                Document document = null;
                try
                    SaveFileDialog savefiledg = new SaveFileDialog();
                    savefiledg.Filter = "All Files | *.* ";
                    if (savefiledg.ShowDialog() == DialogResult.OK)
                        string path = savefiledg.FileName;
                        document = new Document(PageSize.A4, 3, 3, 10, 5);
                        PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(path + ".pdf", FileMode.Create));
                        document.Open();
                        // Creates a phrase to hold the application name at the left hand side of the header.
                        Phrase phApplicationName = new Phrase("Sri Lakshmi Finance,Hosur-560068", FontFactory.GetFont("Arial", ApplicationNameSize, iTextSharp.text.Font.NORMAL));
                        // Creates a phrase to show the current date at the right hand side of the header.
                        Phrase phDate = new Phrase(DateTime.Now.ToLongDateString(), FontFactory.GetFont("Arial", datesize, iTextSharp.text.Font.NORMAL));
                        document.Add(phApplicationName);
                        document.Add(phDate);
                        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("D:\\logo.JPG");
                        document.Add(img);
                        iTextSharp.text.Font font5= iTextSharp.text.FontFactory.GetFont(FontFactory.TIMES_ROMAN, 5);
                        iTextSharp.text.Font font6 = iTextSharp.text.FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 6);
                        //float[] columnDefinitionSize = { 2.5f, 7.0f,6.6f, 8.6f, 6.6f, 5.0f, 4.5f, 7.0f, 6.3f, 7.0f, 3.5f, 6.0f, };
                        PdfPTable table = null;
                        table = new PdfPTable(dataGridView1.Columns.Count);
                        table.WidthPercentage = 100;
                        PdfPCell cell = null;
                        foreach (DataGridViewColumn c in dataGridView1.Columns)
                            cell = new PdfPCell(new Phrase(new Chunk(c.HeaderText,font6)));
                            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                            cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
                            cell.BackgroundColor = new iTextSharp.text.BaseColor(240, 240, 240);
                            table.AddCell(cell);
                        if (dataGridView1.Rows.Count > 0)
                            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                                PdfPCell[] objcell = new PdfPCell[dataGridView1.Columns.Count];
                                for (int j = 0; j < dataGridView1.Columns.Count - 0; j++)
                                    cell = new PdfPCell(new Phrase(dataGridView1.Rows[i].Cells[j].Value.ToString(), font5));
                                    cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
                                    cell.VerticalAlignment = PdfPCell.ALIGN_LEFT;
                                    cell.Padding = PdfPCell.ALIGN_LEFT;
                                    objcell[j] = cell;
                                PdfPRow newrow = new PdfPRow(objcell);
                                table.Rows.Add(newrow);
                        document.Add(table);
                        MessageBox.Show("PDF Generated Successfully");
                        document.Close();
                    else
                        //Error 
                catch (FileLoadException fle)
                    MessageBox.Show(fle.Message);
                    MessageBox.Show("Error in PDF Generation", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Runtime Gridview content:
    Generated PDF File:
    Thanks & Regards RAJENDRAN M

    Hi Everyone,
       I have created simple Desktop app in that I trying to generate PDF file from Datagridview...when I click on ExportPDf button Pdf file is generation successfully but the issue is in that pdf whatever the images has present in datagridview that images
    are not generation into PDF only the text contents are Present in PDF file.
      Does any one can tell me how to generate the PDF file along with images.
    Here is my code:
      private void btnexportPDF_Click(object sender, EventArgs e)
                int ApplicationNameSize = 15;
                int datesize = 12;
                Document document = null;
                try
                    SaveFileDialog savefiledg = new SaveFileDialog();
                    savefiledg.Filter = "All Files | *.* ";
                    if (savefiledg.ShowDialog() == DialogResult.OK)
                        string path = savefiledg.FileName;
                        document = new Document(PageSize.A4, 3, 3, 10, 5);
                        PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(path + ".pdf", FileMode.Create));
                        document.Open();
                        // Creates a phrase to hold the application name at the left hand side of the header.
                        Phrase phApplicationName = new Phrase("Sri Lakshmi Finance,Hosur-560068", FontFactory.GetFont("Arial", ApplicationNameSize, iTextSharp.text.Font.NORMAL));
                        // Creates a phrase to show the current date at the right hand side of the header.
                        Phrase phDate = new Phrase(DateTime.Now.ToLongDateString(), FontFactory.GetFont("Arial", datesize, iTextSharp.text.Font.NORMAL));
                        document.Add(phApplicationName);
                        document.Add(phDate);
                        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("D:\\logo.JPG");
                        document.Add(img);
                        iTextSharp.text.Font font5= iTextSharp.text.FontFactory.GetFont(FontFactory.TIMES_ROMAN, 5);
                        iTextSharp.text.Font font6 = iTextSharp.text.FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 6);
                        //float[] columnDefinitionSize = { 2.5f, 7.0f,6.6f, 8.6f, 6.6f, 5.0f, 4.5f, 7.0f, 6.3f, 7.0f, 3.5f, 6.0f, };
                        PdfPTable table = null;
                        table = new PdfPTable(dataGridView1.Columns.Count);
                        table.WidthPercentage = 100;
                        PdfPCell cell = null;
                        foreach (DataGridViewColumn c in dataGridView1.Columns)
                            cell = new PdfPCell(new Phrase(new Chunk(c.HeaderText,font6)));
                            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                            cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
                            cell.BackgroundColor = new iTextSharp.text.BaseColor(240, 240, 240);
                            table.AddCell(cell);
                        if (dataGridView1.Rows.Count > 0)
                            for (int i = 0; i < dataGridView1.Rows.Count; i++)
                                PdfPCell[] objcell = new PdfPCell[dataGridView1.Columns.Count];
                                for (int j = 0; j < dataGridView1.Columns.Count - 0; j++)
                                    cell = new PdfPCell(new Phrase(dataGridView1.Rows[i].Cells[j].Value.ToString(), font5));
                                    cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
                                    cell.VerticalAlignment = PdfPCell.ALIGN_LEFT;
                                    cell.Padding = PdfPCell.ALIGN_LEFT;
                                    objcell[j] = cell;
                                PdfPRow newrow = new PdfPRow(objcell);
                                table.Rows.Add(newrow);
                        document.Add(table);
                        MessageBox.Show("PDF Generated Successfully");
                        document.Close();
                    else
                        //Error 
                catch (FileLoadException fle)
                    MessageBox.Show(fle.Message);
                    MessageBox.Show("Error in PDF Generation", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Runtime Gridview content:
    Generated PDF File:
    Thanks & Regards RAJENDRAN M
    Hello,
    Since this issue is mainly related to iTextSharp which belongs to third-party, I would recommend you consider posting this issue on its support website to get help.
    Maybe the following forum will help.
    http://support.itextpdf.com/forum/26
    Regards,
    Carl
    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.

  • AS3: TextField - How do get rid of text select cursor

    SC3 - AS3
    How do we turn off the text select cursor?
    I have a button object that has dynamic text, and the hand
    cursor works fine outside of the text object but over the text
    object the cursor is changing to a text select cursor!
    I am setting selectable to false for the text field.

    Is your dynamic text field part of a button? I just created a
    test file with a dynamic text field set to not selectable and it is
    not showing the text cursor.
    Also, are you dynamically generating the text field or are
    you drawing it on the stage?

  • How to change the default text "There are no items to show in this view" in the visual webpart

    Hi,
    I am using a visual webpart and in that if there are no items in the list it is showing the default text "There are no items to show in this view." I want to change this default text. 
    I checked the forums here there are multiple ways are shown but no one is working for me.
    Kindly help me to change this text.
    Thanks in advanced.

    It seems you're retrieving items inside a specific you.. why not having a <div> inside you're visual web part and check to see if the count of items retrieved is > 0 then insert that in the div, otherwise, insert your custom message and not rendering
    the web part itself. What you're describing is the default message from SharePoint which comes from default views, and this can be changed from xslt in SP 2010 or in JSLink in SP 2013, here's a link how to do so in JSLink :
    http://www.idubbs.com/blog/2015/jslink-csr-to-override-there-are-no-items-to-show-in-this-view/ .
    But as said, since you're doing a visual web part, keep your stuff in the visual web part and check for the count of items before adding the rendered data to your div.  
    Mohamed Derhalli
    SharePoint Consultant
    Blog: SharePoint Thoughts
       Twitter:
    LinkedIn:
      

  • Unable To Use Flash Drawing Or Text Tools--Help!

    I'm a Flash CS4 user and two days ago started having a strange problem--when I use any of the drawing or text tools in
    Flash, my work disappears as soon as I let go of the mouse button! I've tried reinstalling Flash and that didn't work, and I can't think of any internal settings that could be causing this. And strangely, I'm running Fireworks CS4 on the same computer and am not having any problems with it. Has anyone experienced this? Any help would be appreciated.

    Flash Player 12.0.0.43 Plug-in (All other browsers)
    First, use the Flash Player Uninstaller

  • How do I leave editable text and images in a PDF?

    I recently bought a flyer template and it came as an editable PDF.  Here is one of the templates http://www.wendygarratt.com/images/flyer.pdf
    Every field, both text and graphic object, is fully editable in the free Adobe reader.  I have Acrobat X and have tried all the methods of producing something like this but nothing has worked.  I wish to produce not just one page template PDFs that can be edited like the one above, but I also have a 20+ page magazine, which currently is distributed in PDF form and I wanted certain image and text fields within the magazine to be customisable too. 
    I design the magazine using InDesign and the exported pages are composed of 1 large background image with text fields laid over the top.  I have tried exporting it as an interactive PDF, ticking the layers option for Acrobat, but when I try to create an editable form (Tools>Forms>Create>Open file) it does not recognise any of the text fields at all.
    Can someone please help me before I slam my head repeatedly in a door?  I have been searching for a solution for so long and I'm getting rather frustrated.
    Thank you in advance
    Wendy-G

    Thanks for the replies I've had so far, but I really need some detailed help to sort this.
    I want to be able to create a PDF that has editable text and editable graphics over a background image, that can be edited in the free Adobe Reader, as per this item - http://www.wendygarratt.com/images/flyer.pdf
    I know this was designed in LiveCycle and I have LiveCycle and Adobe Acrobat Pro X, but LiveCycle is new to me.  I am a quick learner (I use Photoshop, InDesign, etc) and need help in getting started.
    I am willing to work with someone to help get this sorted but it is urgent that I get to grips with this.
    Thanks so much for helping
    Wendy-G

  • Using setViewRect to locate a particular are in a PDF

    Hello,
    We have a Delphi application in which we are using a TAcroPDF component.
    With Acrobat 9 Pro, when we need to locate a particular area in a PDF we use the function setViewRect(left, top, width, height) . Since we updated to Acrobat Reader X, the setViewRect function does not work properly. The vertical scrollbar does not move for whatever the values given as parameters in the setViewRect function.
    Also, we notice that if we change regional settings to EN, we also have a different behaviour.
    Could you please help us to be able to locate a particular area in a given PDF ?
    Thanks

    Thank you.  At this point I guess our only hope is that it's sitting on a shelf somewhere at the house and my kid and my dad are just terrible at finding things.

  • How use SDK to insert text in indesign using c++

    Hello All
    I want to  use Indesign CS5.5 SDK  in my  c++ project first to create Indesign Document then insert text in textframe.
    How include SDK in my project ?
    Is it right method to create indesign Application using SDK.
    #include "IApplication.h"
    #include "ISession.h"
    # include "IDocumentCommands.h"
    virtual IApplication *  QueryApplication()=0 ;
    ISession *  GetExecutionContextSession();
    IApplication application(GetExecutionContextSession()->QueryApplication());
    It required so many .h file, first I copy .h file from SDK and put in Project directory but it give some error after including these .h file in project.
    There are so many directory(source,build,docs, etc.) in SDK.How include and use this SDK in my project to create Indesign Document.
    How include so many  .h file in my project ?
    I have already included SDK path in VisualStudio2008 ->Tools->Option->ProjectSolutions->vc++Directories
    Thanks.

    Hi Jongware,
    This is not correct in C# you have type cast all the object to another Object and then only we can access it in required format
    for example
    if want to get font in active Document
    InDesign.Application myInDesign=  (InDesign.Application) COMCreateObject("InDesign.Application");
    InDesign myDocument = (InDesign.Document)myInDesign.ActiveDocument;
    InDesign.ParagraphStyles pStyles = (InDesign.ParagraphStyle)myDocument.ParagraphStyles
    InDesign.ParagraphStyle pSteyls = (InDesign.ParagraphStyle)myDocument.ParagraphStyle
    for(int i =0;i<pStyles.Count;i++)
         pStyle = (InDesign.ParagraphStyle)myDocument.ParagraphStyles[i];
    public static object COMCreateObject (string sProgID)
        // We get the type using just the ProgID
        Type oType = Type.GetTypeFromProgID (sProgID);
        if (oType != null)
            return Activator.CreateInstance( oType);
        return null;
    like above content
    for selection content u have to type cast selection object.
    InDesign.Selection = (InDesign.Selection).myDocument.Selection;
    Console.Writeline(InDesign.Selection.Contents);
    but it showing error....
    like this you have to type cast all things in C# and you cannot simply get selection contents like app.selection[0].contents
    pls help me
    Thank you for your reply....
    R. Thangaraj

  • How use insert more than query (select)

    insert into FISH_FAMILIES (id,code ,SCIENCE_NAME,ARABIC_NAME,LATIN_NAME,IS_FAMILY)
    SELECT ROWNUM,to_char(ROWNUM) FROM dual CONNECT BY LEVEL <= 43,
    select distinct FAMILY, ARABIC_DESCRIPTION,LATIN_DESCRIPTION from FISH_SPECIES ,
    select distinct IS_FAMILY from FISH_SPECIES
    iam dont know format insert use
    More than select ??????

    ali_alkomi wrote:
    ORA-01427: single-row subquery returns more than one row
    insert into FISH_FAMILIES(SCIENCE_NAME,ARABIC_NAME,LATIN_NAME,IS_FAMILY)
    values ( (select distinct FAMILY from FISH_SPECIES) ,(select ARABIC_DESCRIPTION from FISH_SPECIES) ,(select LATIN_DESCRIPTION from FISH_SPECIES),(select distinct IS_FAMILY from FISH_SPECIES
    ))You were given an answer to that over on your other question:
    How Generating Series Of Numbers Without  use Sequences
    If you are haivng a problem understanding the answers, do not start a new thread, otherwise the same people who were helping you originally may not know you are still having a problem.
    To insert multiple rows of data you cannot use the VALUES clause of the INSERT statement (as it tells you in the documentation if you read it).
    You need:
    INSERT INTO ...
    SELECT ... FROM ... UNION ALL
    SELECT ... FROM ... UNION ALL
    SELECT ... FROM ... etc.or, in your case you would need something more simply like
    insert into FISH_FAMILIES(SCIENCE_NAME,ARABIC_NAME,LATIN_NAME,IS_FAMILY)
    select fs.family, fs.arabic_description, fs.latin_description, fs.is_family
    from   fish_species fs

  • Can't use mouse in track header/mixer area... gulp?

    It seems I've inadvertently locked myself out of being able to edit/manage tracks in the header area-- anyone experience this problem? I can use keyboard shortcuts with no problem, and the cursor works in the bottom window, but anything from selecting a track to controlling track volume in the header is useless-- just doesn't respond. Anyone seen this before?
    Thanks!

    If you want to see the strategy status on the legend I think you should probably structure your table like the following:
    Sub Focus Area       Status              Strategy Count
    ===========      =========     ========
    Sub Focus Area 1    Implemented       23
    Sub Focus Area 1    In Progress           5
    Sub Focus Area 1    Not Started           3
    Sub Focus Area 2    Implemented       28
    Then the status will show up as a column that you should be able to drag into the legend area.
    http://darren.gosbell.com - please mark correct answers

  • How do I listen to the selected area I want to cut (b4 I cut it) so I know my timing is right?

    Trying to make a clean version of a song. Once I select the area I want to cut, how do I listent to the shaded part of the song I have selected before I cut it? I don't want to cut the part that is approximately the area. I want to be sure b4 I delete it.

    There's no way in GB to listen to just a selected region. You will always have to move the playhead to the starting point of that region and press play. However, if you double-click the region and look at its waveform in the finder, you can see very exactly where the sounds start and end, that gives you a very precise option to split and cut your regions.

  • How use google voice for texting so don't get charged from att???

    can't find the correct settings to avoid being charged???
    do I need to download google voice app on iphone ?

    No, it doesn't support that. I mentioned the details in your other thread. To add to the other question, you must go to Google Voice settings on the web and make sure that your messages aren't automatically forwarded as text messages. If that is checked, you will receive a text message (which will charge) and a push notification (which will not charge). As mentioned before, you should simply use push notification to get your messages.

  • How to check the availability of selection

    Hello to all !
    I have a script fills in the  selected area. But if the user has not made a selection, the string Mybounds = doc.selection.bouns an error. How I can check is the selection are not ?

    You could wrap (var myBounds = app.activeDocument.selection.bounds) in a try clause.

Maybe you are looking for