PDFlib --pixels? 2

From: Date: Tue, 30 Jul 2002 23:07:04 +0000
Subject: PDFlib --pixels? 2
Groups: php.general 
Request: Send a blank email to php-general+get-110431@lists.php.net to get a copy of this message
Sorry, The code wasn't complete for the scaling thing. $dpi_x =PDF_get_value($p,"resx",$image); $dpi_y =PDF_get_value($p,"resy",$image); /*calculate scaling factors from the dpi values */ if ($dpi_x >0 && $dpi_y >0){ $scale_x =(72.0)/$dpi_x; $scale_y =(72.0)/$dpi_y; } else if ($dpi_x <0 && $dpi_y < 0){ $scale_x = 1.0; $scale_y = $dpi_y / $dpi_x; } else { $scale_x =1.0; $scale_y =1.0; } PDF_begin_page($p,PDF_get_value($p,"imagewidth",$image)*$scale_x, PDF_get_value($p,"imageheight",$image)*$scale_y); PDF_scale($p,$scale_x,$scale_y); PDF_place_image($p,$image,0.0,0.0,1.0); PDF_close_image($p,$image); THANKS! :) Oscar.-

« previous php.general (#110431) next »