Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
"be consistent"
 
PerlMonks  

Re: Re: Re: OCR Code

by CombatSquirrel (Hermit)
on Dec 11, 2003 at 14:25 UTC ( [id://314127]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: OCR Code
in thread OCR Code

You won't need an OCR if you have the number in a text file or in a PDF file.
In the case of the text file, a simple Perl program will suffice, in the case of the PDF file, you will have to resort to one of the PDF modules, which I mentined above, but again: you will not need OCR in this case.
If this does not help you, I would suggest you to read How (Not) To Ask A Question and then restate qour question in a way which is better to understand as a reply to your original post.

Cheers,
CombatSquirrel.
Entropy is the tendency of everything going to hell.

Replies are listed 'Best First'.
Re: Re: Re: Re: OCR Code
by Anonymous Monk on Dec 11, 2003 at 14:32 UTC
    Let me explain you in detail. Suppose i have number 0304948457575747483322 in text file. Step-1 : i want put this number into .pdf file. when i generate this .pdf file default font is helvetica. OCR reader will not read this helvetica fonts. I have to convert this number into OCR font first and then put it in a .pdf file.so OCR reader can read that number.
      If the following does not help you, please do not respond to this node. As you might have seen from the whole thread, people are at different levels of annoyal when they see someone asking to give ready-to-use code according to really fuzzy specs with no explanation of their significance. Again, do not respond to this node.
      #!perl use strict; use warnings; use PDF::Create; *IN = \*DATA; # open IN, '<', 'infile.txt' # or die "Could not open 'infile.txt': $!\n"; my $number; for (<IN>) { if (/(\d+)/) { $number = $1; last; } } close IN; die "Could not find number in file 'infile.txt'\n" unless defined $number; ### This comes straight from the PDF::Create docs, ### with just slight modifications my $pdf = new PDF::Create('filename' => 'mypdf.pdf', 'Version' => 1.2, 'PageMode' => 'UseOutlines', 'Author' => 'CombatSquirrel', 'Title' => 'The title', ); my $root = $pdf->new_page('MediaBox' => [ 0, 0, 612, 792 ]); # Add a page which inherits its attributes from $root my $page = $root->new_page; # Prepare 2 fonts my $f1 = $pdf->font('Subtype' => 'Type1', 'Encoding' => 'WinAnsiEncoding', 'BaseFont' => 'Courier'); # Add something to the first page $page->stringl($f1, 12, 306, 300, $number); # Add the missing PDF objects and a the footer then close the file $pdf->close; __DATA__ junk junk more junk line 0304948457575747483322 more text text text end

      Regards,
      CombatSquirrel.
      Entropy is the tendency of everything going to hell.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://314127]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.