Reading text and charachters from image

Hi,
Is there anyone that could share code to extract/collect text from images? I've tried nConvert and gocr but its not working very well (also its external programs). I would be extremley grateful if someone could share som code to parse the texts and numbers from an image.
Thanks in advance!
BR

To answer your question - I'm teaching myself java and I haven't covered enumeration classes yet.
With the setGender("Q") scenario, the data in the text file has already been validated by other methods before being written to the file. Anyway I worked out my problems were caused by "input = read.readLine()" being in the wrong places. The code below works fine though I've left out the set and get methods for the time being.
Chris
public static void readFile()throws IOException{
String name = "";
String gender = "";
int age = 0;
BufferedReader read = new BufferedReader(new FileReader("myfile.txt"));
String input = read.readLine();
while(input != null){
name = input;
input = read.readLine();
gender = input;
input = read.readLine();
age = Integer.parseInt(input);
input = read.readLine();
System.out.println("Name: " + name + " Gender: " + gender + " Age: " + age);
read.close();

Similar Messages

  • How to create a plugin to stamp texts and not an image into a pdf document

    How to create plugin to stamp texts and not an image.. i just want it to work like the stamper plugin found in sdk sample but here i need text to be stamped instead of an image.. Is it possible? kindly give me some ideas?how to go about it.. can this be done by modfying the stamper sample code?
    Thank you

    This is possible, but it is a serious project, not something to be cut around from sample code. You will need to study the "graphics" and "text" chapters of the PDF specification in some detail to understand the PDF graphics model, including colour spaces, graphics state, and transformation matrixes; if working with annotations understand them and the requirement for appearance stream. There are various ways to add content to a PDF, but the PDFEdit API is probably the most accessible.

  • Dynamically passing text and url-based images as an input parameter to cf8 report builder

    I'm unsuccessfully trying to dynamically pass text and url-based images to a group footer or the detail section via an input parameter or even hardcoded. The field has the attribute 'XHTML Text Formating' set to True. The following are failed samples of a simplified value:
    "<img height=’300’ alt=’Document’ width=’300’ src=’http://www.google.com/intl/en_ALL/images/logo.gif’ />"
    or
    "<img src=’http://www.google.com/intl/en_ALL/images/logo.gif’ />"
    This just results in the above text being output. The end result would have various text and images from a database as input by a user, thus the reason I cannot just use the hyperlink information attribute as I could if it were a single known image. I tried rtf and pdf report types. Ideas?

    HTH,
    Thanks. I'll keep that in mind, although I don't know how many images my user might need or what sizes so that might be tricky.
    Since my target output is rtf so that MS Word can be used to edit the result, I added a pagebreak to a MS Word doc and used the resulting html source to replace the rich text editor source code for the page break, but that did not help either. The page break was so a user could add an image later. Something is wrong with the Report Builder related to intepreting XHTML, especially anything that has an attribute, including URL-based image links. I hope they try to provide another update before CF9. I doubt my client will be going to CF9 for some time, since they are just completing the migration to CF8.
    BrianO

  • Find text and replace with image - Help needed

    Hi,<br /><br />We need to place the images as inline in the appropriate places.<br /><br />texttexttext<<test1.eps>>texttexttexttexttexttext<<test2.eps>>texttexttexttexttexttext< <test3.eps>>texttexttexttexttexttext<<test4.eps>>texttexttexttexttexttext<<test5.eps>>text texttext<br /><br />This code is helpful for placing a single image at a time, we are unable to place all the images in one shot, can anyone help me out.<br /><br />I am not a programmer.<br /><br />-----------<br />var myDoc = app.activeDocument; <br />app.findPreferences = app.changePreferences = null; <br />var math=document.search("test.eps"); <br />for (i=math.length-1; i >=0; i--)<br />{ myDir = Folder.selectDialog(); <br />AllGraphics = Folder(myDir).getFiles('test.eps') <br />for (i=0; i<math.length; i++) { app.select(anil1[i]); <br />     myDoc.place(AllGraphics[i],false); } }<br />-----------<br /><br />Note: I have taken this code from forum and we have made some changes on this.<br /><br />Kavya

    Jongware,<br /><br />I try running it but gives errors:<br /><br />Error Number: 55<br />Error String: Object does not support the property or method 'changePreferences'<br />Line: 24<br />Source: app.findPreferences = app.changePreferences = null;<br /><br />This is the code I used<br /><br />// Find text and replace with image for InDesign CS3 <br />// http://www.adobeforums.com/webx?128@@.3bbf275d.59b6f012<br />var heyItsAnArray = new Array ( <br /><br />   "it contains this line!", <br /><br />   "as well as this one", <br /><br />   "or even more!", <br /><br />   "test.eps" ); <br /><br />for (arrayCount=0; arrayCount<heyItsAnArray.length; arrayCount++) <br /><br />{ <br /><br />   replaceImg (heyItsAnArray[arrayCount]); <br /><br /> } <br /><br />function replaceImg (name) <br /><br />{ var myDoc = app.activeDocument;  <br />     app.findPreferences = app.changePreferences = null;  <br />     var math=document.search(name); <br />     for (i=math.length-1; i >=0; i--)  <br />     { myDir = Folder.selectDialog();  <br />          AllGraphics = Folder(myDir).getFiles(name)  <br />          for (i=0; i<math.length; i++) { app.select(anil1[i]); <br />               myDoc.place(AllGraphics[i],false); <br /><br />               } <br /><br />          } <br /><br />     }<br /><br />Michael

  • Can i backup my texts and messenges from iphone to my pc, can i backup my texts and messenges from iphone to my pc

    can i backup my texts and messenges from iphone to my pc, can i backup my texts and messenges from iphone to my pc??

    Hi Dimi129,
    You can use Photo Stream to sync the photos and videos or you can use an app like DropBox: When you open the app in iPhone/iPad you can upload your Camera Roll to your DropBox folder (you need a DropBox Account) and later, in your iPad/iPhone, you can open the app again and download what you need.
    Greetings,

  • IPhone 5S not receiving texts and pictures from Android without data on

    I have a 4 month old iPhone 5S and for some reason I'm not able to receive texts and photos from my friends who have Android phones. The only time I receive them is when I turn my data on. I have a very limited data plan and I would prefer to only turn it on in the case of an emergency, not to receive texts from friends. As of now, it seems that my phone is perfectly able to send texts to them, I just can't receive them.
    HELP!

    iOS: Troubleshooting Messages
    A cellular data connection is needed to receive and send MMS per the above link.

  • My employer and I both have iPhone 5.  We both recently updated as recommended.  Now we can no longer text each other.  I can text and receive from other iPhone users.  Any ideas??

    My employer and I both have iPhone 5.  We both recently updated as recommended.  Now we can no longer text each other.  I can text and receive from other iPhone users.  Any ideas??

    Well, that didn't work since I am already using my appleID for both FaceTime and iMessage but i did see the option to send as SMS when iMessage not available.  so I am now able to send to him  but I don't know if he can send to me.  It's a start.  It is only with his phone.  His wife has a Galaxy and they are both on AT&T and she can send and receive.  I am on sprint.  If that info helps

  • How do I copy text and objects from pages to and paste into Email, objects don't show in Email

    Anyone know how I copy text and objects from pages and paste into Email, objects don't show in Email, thanks

    You can't expect Mail to support all the objects of Pages which can include anything up to charts generated from spreadsheet tables.
    Even if Mail was a superset of Pages, what would the recipients who don't have either Mail or Pages, make of it?
    Peter

  • How can I transfer text and format from a Word Doc to a new Pages Doc?

    How can I transfer text and format from a Word Doc to a new Pages Doc?

    Select, and Copy in the Word doc and Paste in the Pages doc. It may not be perfect. Importing (Opening) the Word doc is probably better than using Copy/Paste for large amounts of content.
    Jerry

  • [svn] 3292: Update Download text and link from Flex 2 to Flex 3.

    Revision: 3292
    Author: [email protected]
    Date: 2008-09-22 08:49:21 -0700 (Mon, 22 Sep 2008)
    Log Message:
    Update Download text and link from Flex 2 to Flex 3.
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/javascript/FABridge/samples/srcview/SourceIndex.xml

    I haven't done any charts, so I can't be much specific help,
    but start with the MigrationGuide, here:
    http://download.macromedia.com/pub/documentation/en/flex/2/flex2_migrationguide.zip
    Then run the example and debug it.
    You might also be able to find updated examples here:
    http://www.adobe.com/devnet/flex/
    Tracy

  • How to read tables and fields from a transaction screen.

    hi all,
    i am having problem in reading fields and tables from a screen, could any one help me in mapping tables from a structure as well.
    it will be very help full if u had any documentation.
    Thanking u
    kiran

    Hi,
    In classical debug mode from CALL STACK tab try to find out the structures holding the screen values .
    Capture the values from transaction using FIELD SYMBOLS .
    See the below code.
    DATA : l_prog_val(50) TYPE c VALUE '(SAPLCTMS)WI[]'.
    **To get the (SAPLCTMS)WI value in this program from call stack.
      FIELD-SYMBOLS: <wi> TYPE ANY.
    *Assign the structure (SAPLCTMS)WI to field symbol
      ASSIGN  (l_prog_val) TO <wi>.
      IF sy-subrc NE 0.
        EXIT.
    *Assign the structure (SAPLCTMS)WI to internal table
      ELSE.
        it_wi[] = <wi>.
      ENDIF.
    Sastry.

  • Plz any 1 can explain what read form and control from do in alv

    plz any 1 can explain what read form and control from do in alv

    Hi,
    <b>READ_FORM</b> is used to get the form related data like WINDOWS, PAGE WINDOWS, etc
    <b>CONTROL_FORM</b>
    SAPscript control commands can be carried out with CONTROL_FORM. The
    command should be specified without the paragraph format '/:' in the
    parameter COMMAND.                                                 
    EX..
      CALL FUNCTION 'CONTROL_FORM'
           EXPORTING
                COMMAND   = 'PROTECT'
           EXCEPTIONS
                UNOPENED  = 01
                UNSTARTED = 02.
    Thanks,
    Naren

  • Reading files and directory from a directory

    ublic static void readFromDirectory(String dirName) {
              // stop word ArrayLists
              ArabicStop();
              EnglishStop();
              FrenchStop();
              SpanishStop();
              DutchStop();
              File dir = new File(dirName);
              if (dir.isDirectory()) {
                   String[] child = dir.list();
                   System.out.println("hi Iam here");
                   for (int i = 0; i < child.length; i++) {
                        readFromDirectory(child.toString());
              File[] files = dir.listFiles();
              if (files == null) {
                   System.out.println("There are no files in this Directory ");
              } else {
                   for (int j = 0; j < files.length; j++) {
                        String filename = files[j].toString();
                        readFile(filename);
                   if (dirName.equalsIgnoreCase("English")
                             || dirName.equalsIgnoreCase("Nonenglish")) {
                        for (int i = 0; i < a2.size(); i++) {
                             keyWord = a2.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                   } else if (dirName.equalsIgnoreCase("Spanish")) {
                        for (int i = 0; i < a5.size(); i++) {
                             keyWord = a5.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                        //System.out.println(m1);
                   } else if (dirName.equalsIgnoreCase("French")) {
                        for (int i = 0; i < a3.size(); i++) {
                             keyWord = a3.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
         public static void main(String[] args) {
              int countText = 0;
              int c;
              test t1 = new test();
              System.out.println("IN NON - ENGLISH DOCUMENTS - P :");
              t1.readFromDirectory("NonEnglish");
              for (int j = 0; j < text.size(); j++) {
                   if (!text.get(j).toString().equalsIgnoreCase("")) {
                        countText++;
              c = countText;
              //System.out.println(c);
              //System.out.println(text.size());
              for (int i = 0; i < a2.size(); i++) {
                   String word = a2.get(i).toString();
                   String m = (m1.get(word)).toString();
                   double x = Double.parseDouble(m);
                   System.out.println(word + ":" + (x / c) * 100 + " %");
    I wanna read text files from directory that contain - lots of other directorys... and by using this code I have error,,,
    Can anyone help me plzzz
    Edited by: Shamma on Oct 9, 2008 3:32 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You actually have more than 1 problem: you cannot traverse directories recursively and you get a NullPointerException.
    For the first problem you might want to verify what this statement returns:
    child.toString() (I honestly don't understand why you are calling toString() on a String object, but that's not the real problem!)
    You probably expect it to be a full absolute path.
    The NullPointerException has already been pointed out by masijade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to read text and it's font details (Family and size) using Acrobat plugin?

    Hello,
           I have query about reading PDF, I wanted to extract text and it's font details (Family and size) using Acrobat plugin. How can I achieve that?
    Any suggestions are welcome.
    Thanks
    Rohit Shinde

    Look at the samples in the SDK around PDFEdit and the PDEdit APIs.

  • How do I stop my texts and pictures from going to other devices with same Apple ID

    I share my Apple ID with my son on his Ipad and I phone.  how do I stop my photos and messages from automatically going to his devices.

    It should be iMessages which are going from device to device, you can turn this off in recipient device. The same sort of thing for Photos, however on your phone/ipad you can turn off 'Photo Stream" which will stop the sending to other devices.  You can do this under Settings>Photos & Camera.
    Regards,
    Steve

Maybe you are looking for

  • Error In Running dbms_scheduler.run_job ORA-27369 with psexec.

    I'm using dbms_scheduler in Oracle 10g on Windows 2008 (32-bit). A recent application upgrade moved a portion of my work to a Windows 2008 R2 64-bit server. Becuase of this I had to move some processing to this server. When the internal processes wit

  • Contract update with reference to an order

    Hello everybody, I'm trying to find a way to update the contract value released (AWERT field in RV45A structure) when an additional order is created with reference to an existing one. Thank you in advance. Mike Edited by: Michael Papadakis on Dec 22,

  • How to control the button available in SRM 7.0

    Dear ,expers :    I work in SRM 7.0 .SP 09 You know ,the purchaser can do the "renew "in contract in the purchaer's view .But in my case ,some purchaser can do this ,but other nerver .So I just want to control the button available though the user rol

  • WM-Purchase order -return transfer order

    hi friends   i did purchase order ,GRN ,TR, TO.. i did wrongly Transfer order..i want return to move the stock other storage bin.... with regards dinesh Moderator message: Locked. Reason: basic question. Please search how to cancel transfer order or

  • 'Access Denied' when installing power manager on x220 laptop

    Hello, My original problem that lead me to the power manager is trying to get bluetooth installed. I read on a non lenovo forum that uninstalling and reinstalling the power manager would give me the option to add a bluetooth device under "Devices and