Greetings: First let me get the obligatory excuses out of the way - I am a total hack in the ways of Perl and have never had any background in any other program or scripting languages so forgive if the examples are I give are head scratchers. Anyway, on to the question!!!
I am working on a program that interacts wih our Oracle based Document Management System that will allow users to grab documents from said program while in another program without having to log in each time. My program goes out and finds the TIFF images it needs than uses them to create a PDF file and display the pdf file thru iexplorer. The problem is that the images were originally scanned at many different page sizes and the way I have set up my PDF creation sub distorts the original image if scanned other than 8.5X11. Is there a way to bring the tiff files in and have the page size scale automatically fit the dimensions if the image? Or is there a way to get each individual image files dimensions and plug those into the script? Sorry for the long winded question - the pdf creation portion of my script is below:
my $pdf = PDF::API2->new(-file=>"$PdfOut"); for ($a=0;$a<=$#TifList;$a++) { $ImgFilePath =join(".",$TifList[$a][1],$TifList[$a][3]); $ImgFilePath=~tr/\\/\//; chomp $ImgFilePath; my $page = $pdf->page; $pdf->preferences(-fit=>1, -fitwindow =>1 ); $page->mediabox(8.5/in, 11/in); my $img = $page->gfx; die("Unable to find image file: $!") unless -e "$ImgFilePath"; my $ImgFile = $pdf->image_tiff("$ImgFilePath"); $ImgFile, .1/in, .1/in, 8.4/in, 10.75/in ); $img->image($ImgFile); } $pdf->save; $pdf->end; system( "start iexplore.exe -e $PdfOut");

In reply to API2 Working with Tiff's by tex4ever54

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.