将细胞定位在fpdf中

时间:2013-06-13 00:26:59

标签: php fpdf

我刚刚开始使用fphp,并设法获得pdf文档,因为我想要它只有一个问题。我目前有这个:

Bars

我用来获取它的代码是:

$pdf->MultiCell(0,5, "Feedback: " ."",0, "J");
$pdf->SetFillColor(185, 44, 146);
$pdf->Cell($obsObservation1,5,"",0,1,1,"L", "true");

$pdf->MultiCell(0,5, "Challenge: " ."",0, "J");
$pdf->SetFillColor(197, 198, 200);
$pdf->Cell($obsObservation2,5,$currentY,0,1,1,"L", "true");

我希望文本右侧有两个条形,左侧有条形。这可能吗?

我意识到我或许不应该使用细胞,但我似乎无法找到正确的选择。

1 个答案:

答案 0 :(得分:0)

不要使用多单元...

只做普通的细胞......

PS:这可能不会像我输入它那样正常工作,但它的内容沿着这些方向...... 玩它,你会得到它。 :)

$pdf->SetY(0);
$pdf->SetFont("Arial","B","13");
$pdf->SetXY(5, $pdf->y + 5);
$pdf->Cell(5, 5, "Feedback :");

$pdf->SetY(0);
$pdf->SetXY(15, $pdf->y + 5);
$pdf->Cell($obsObservation1,5,"",0,1,1,"L", "true");


$pdf->SetY(0);
$pdf->SetFont("Arial","B","13");
$pdf->SetXY(5, $pdf->y + 15);
$pdf->Cell(5, 5, "Challenge :");

$pdf->SetY(0);
$pdf->SetXY(15, $pdf->y + 15);
$pdf->Cell($obsObservation2,5,"",0,1,1,"L", "true");