Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: OCR Code

by Anonymous Monk
on Dec 11, 2003 at 15:23 UTC ( [id://314152]=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: OCR Code
in thread OCR Code

I am using same PDF::API2. I also look at http://www.penguin.at0.net/~fredo/files . i did not find any example on OCR font. or how to change font. Do u have any example. thanks Tejas

Replies are listed 'Best First'.
Re: Re: Re: OCR Code
by edoc (Chaplain) on Dec 11, 2003 at 20:51 UTC

    Can you show us your code that uses PDF::API2?

    It should be a simple matter of changing or adding a font definition to your code.

    You should have a font definition in you want to look something like:

    my $doc = PDF::API2->new( -file => 'mypdf.pdf' ); my $page = $doc->page; my $txt = $page->text; my $font = $doc->corefont('OCR A',1); # this font name may be incorrec +t.. $font->encode('latin1'); $txt->font($font,10); $txt->lead(10); $txt->text('Print to PDF file in the font set above'); # ....

    cheers,

    J

      I run the following code for testing. Basically it's same piece of code using OCR_A font.

      It's giving me below error.

      use PDF::API2; my $doc = PDF::API2->new( -file => 'mypdf.pdf' ); my $page = $doc->page; my $txt = $page->text; my $font = $doc->corefont('OCR_A',1); # this font name may be incorrec +t.. $font->encode('latin1'); $txt->font($font,10); $txt->lead(10); $txt->text('Print to PDF file in the font set above');

      Error

      C:\www\cgi-bin>perl tej.pl requested font 'ocra' not installed at c:/perl/site/lib/PDF/API2/Core +Font.pm li ne 84.
      thanks Tejas

      Edited by BazB - added code tags.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://314152]
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.