小智 5
其实你可以用 Clipping 来做到这一点。下面的行将显示 200X300 的照片:
$pdf->Image('photo.JPG', 100, 100, 200, 300, '', true, '', false, 300);
Run Code Online (Sandbox Code Playgroud)
要剪辑它,您需要:
$pdf->StartTransform();
$pdf->Rect(100, 100, 200, 300, 'CNZ'); //Clipping mask (CNZ style makes your day)
$pdf->Image('photo.JPG', 50, 50, 300, 400, '', true, '', false, 300);
//this would actually cut off a 50 units a in each direction.
$pdf->StopTransform();
Run Code Online (Sandbox Code Playgroud)