Jump to content

[SOLVED] PDF Generation using fpdf library


apulmca

Recommended Posts

apulmca,

 

You can use the optional parameters...

 

See here: http://doc-typo3.ameos.com/3.7.0/classFPDF.html#c883bc75c65959ce84adaa102eb22da9

 

$sourceImage = 'images/MyJpg.jpg'

 

$c1 = 20;

$c2 = 40;

$h  = 172;

 

$pdf->Image($sourceImage,$c1,$c2,$h);

 

Scot L. Diddle, Richmond VA

 

Hi,

I was doing it. but I saw that FPDF page unit was set to mm. And now I am passing width and height for image after converting into mm from PX. And all works fine.

 

$pdf->Image($name,$x,$y,pxtomm($w),pxtomm($h));

 

Also, I am giving Pixel to MM conversion function:

 

function pxtomm($px)
{
$mm = (int)floor($px/3.78);
return $mm;

}

 

Hope it will help for someone finding the same.

 

Thanks

PHPOpenSource

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.