Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: Re: OCR Code

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


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

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://314142]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found