【问题标题】:how to add line height in my FPDF file using PHP [duplicate]如何使用 PHP 在我的 FPDF 文件中添加行高 [重复]
【发布时间】:2017-11-08 15:35:30
【问题描述】:

下面的代码有个小问题

<?php
require('fpdf17/fpdf.php');

//A4 width : 219mm
//default margin : 10mm each side
//writable horizontal : 219-(10*2)=189mm

$pdf = new FPDF('P','mm','A4');

$pdf->AddPage();

//set font to arial, bold, 14pt
$pdf->SetFont('Arial','B',14);

//Cell(width , height , text , border , end line , [align] )

$pdf->Cell(200  ,5,'National Remote Sensing Center',1,1,'C');
$pdf->Cell(50  ,5,'Flight REquisition Form',1,1,'C');

我有一个标题和一个副标题。但我需要它们之间的一些线高。谁能告诉线高调整的代码? 提前致谢。

【问题讨论】:

  • 查看文档或示例。
  • @panther - 这里不是 multicell() vs cell() 的另一篇文章吗?似乎略有不同,还是两种情况下的行为相同?

标签: php html fpdf


【解决方案1】:

你能不能只使用 Cell() 方法的第二个参数... 身高?

Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])

h

单元格高度。默认值:0。

来自http://www.fpdf.org/ > 手动 > Cell()

【讨论】:

  • 对不起..但还是感谢您的帮助!
  • 那么会发生什么?你找到解决办法了吗?
  • 是的!我只需要添加一个空单元格.. 它工作正常!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-01
  • 1970-01-01
相关资源
最近更新 更多