logo       

Re: Create image object from image file and then place it on a page...: msg#00028

Subject: Re: Create image object from image file and then place it on a page...
hi!

>I tried some code I found that uses Text/PDF/API/Image.pm to create an image
>from a file but when I use that I get this error:
>
>Can't locate Text/PDF/API/Image.pm in @INC

Text::PDF::API is ages old (1998?) module code long out of service.

the basic code readslike this:

#!/usr/bin/perl
use PDF::API2;

$pdf=PDF::API2->new;
$img=$pdf->image_tiff($imagefilepath);
$page = $pdf->page;
$gfx=$page->gfx;
$gfx->image($img,$lowerLeftX,$lowerLeftY,$scale);
$pdf->saveas("$0.pdf");
$pdf->end();

exit;
__END__

you can use other image_* methods as documented
by 'perldoc PDF::API2' which reads:
#=======================================================
IMAGE METHODS
    $jpeg = $pdf->image_jpeg $file
        Returns a new jpeg image object.

    $tiff = $pdf->image_tiff $file
        Returns a new tiff image object.

    $pnm = $pdf->image_pnm $file
        Returns a new pnm image object.

    $png = $pdf->image_png $file
        Returns a new png image object.

    $gif = $pdf->image_gif $file
        Returns a new gif image object.

    $gdf = $pdf->image_gd $gdobj, %options
        Returns a new image object from GD::Image.

    Options: The only option currently supported 
        is "-lossless => 1".

    Examples:

        $jpeg = $pdf->image_jpeg('../some/nice/picture.jpeg');
        $tiff = $pdf->image_tiff('../some/nice/picture.tiff');
        $pnm = $pdf->image_pnm('../some/nice/picture.pnm');
        $png = $pdf->image_png('../some/nice/picture.png');
        $gif = $pdf->image_gif('../some/nice/picture.gif');
        $gdf = $pdf->image_gd($gdobj);
#=======================================================



cheers,

--
  __              _ 
 / _|_ __ ___  __| | ___    unix, linux, freebsd
| |_| '__/ _ \/ _` |/ _ \   jpeg, png, gif, ppm
|  _| | |  __/ (_| | (_) |  apache, perl, php, mysql 
|_| |_|  \___|\__,_|\___/   pdf, ps, abw, html, pod


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@xxxxxxxxxxxxxxxx

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/perl-text-pdf-modules/

<*> To unsubscribe from this group, send an email to:
    perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe