使用 PHP 和 FPDF 插入图像
我正在尝试插入图像,但不想指定x和y坐标。这可能吗?
$pdf->Image($image1, 5, 70, 33.78);
我希望能够指定大小(33.78),但不能指定x和y,以便它根据内容移动。
$pdf->Write( 70, $reportTitle );
$pdf->Ln( 45 );
$pdf->SetFont( 'Arial', '', 12 );
$pdf->Write( 6, $reportSubtitle );
/**
Create product 1
**/
$pdf->Ln( 10 );
$pdf->SetFont( 'Arial', '', 12 );
$pdf->Write( 6, $prod1title );
$pdf->Ln( 30 );
$pdf->SetFont( 'Arial', '', 10 );
$pdf->Write( 5, $prod1sub );
$pdf->Ln( 30 );
$pdf->Image($image1, 5, 70, 33.78);
以上是我使用的代码。如果$reportSubtitle是两行或三行,它会将$prod 1标题和$$prod 1sub向下推,并且不可避免地在固定的图像下。难道没有办法让图像像产品标题和副标题一样,在仍然声明尺寸的同时也被推倒?