正确的Checkbox换行符

时间:2015-09-24 07:44:46

标签: php pdf tcpdf

我想创建一个复选框,如官方TCPF教程here(简报)中所述。文本应该显示在SAME行中的复选框之后,而不是下一行。为了调试,我在单元格周围画一个边框。 代码:

$pdf->MultiCell(0, 0, '2.4 Welche Arten von Abscheideranlagen betreiben Sie?', $border, $align = 'L', $fill = false, $ln = 1, $x = '', $y = '', $reseth = true, $stretch = 0, $ishtml = false, $autopadding = true, $maxh = 0, $valign = 'T', $fitcell = false);
$pdf->Ln(5);
$pdf->setFormDefaultProp(array('lineWidth' => 1, 'borderStyle' => 'solid', 'fillColor' => array(255, 255, 200), 'strokeColor' => array(255, 128, 128)));
$pdf->CheckBox('separator_light_liquid', 5, $dataset->separator_light_liquid, $prop = array(), $opt = array(), $onvalue = true, $x = '', $y = '', $js = false);
$pdf->Cell(35, 0, 'Leichtflüssigkeit', 1, $ln = 0, $align = 'L', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Ln(5);

PDF-输出:enter image description here

1 个答案:

答案 0 :(得分:0)

作为一种工作方式,我生成一个带边框的单元格。如果该框应该"检查"会写一个' X'进入盒子。没有什么是

($value ? $value = 'X' : $value = null);
$pdf->Cell(5, $h = 5, $txt = $value, $border = 1, $ln = 0, $align = '', 0, $link = '', $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(0, $h = 6, $txt = $label, $border = 0, $ln = 1, $align = '', 0, $link = '', $stretch = 1, $ignore_min_height = false, $calign = 'T', $valign = 'M');

PDF-输出:

enter image description here