$uploaddir = 'download/';
$Date = date("YmdHis");
$filenamepdf = $uploaddir."print".$Date.".pdf";
define('FPDF_FONTPATH','font/');
require('fpdf.php');
$pdf = new FPDF('P','mm','9x6');$pdf->AddPage();
$pdf->SetLeftMargin(1);
$pdf->SetTopMargin(0.1);
$pdf->SetFont('arial');
$pdf->Write(5,'test pdf');
$pdf->Ln();
$pdf->Write(5,'di er heng');
$pdf->Output("$filenamepdf", 'F');
顶边距无论设置多少,都还是那么宽,请问我的代码哪里有问题,还是缺少一些设置
按 fpdf 的原始代码对于
$pdf = new FPDF('P','mm','9x6');
的 $foamat = '9x6' 是要报 Unknown page format: 9x6 错的
因为他 9x6 不在是预设的 a3、a4、a5、letter、legal 之一另外 SetMargins、SetLeftMargin、SetRightMargin 并不是智能化的,需要单独设置。这是 fpdf 的败笔