我已經寫了一些簡單的腳本,將一些文本寫入PDF,導致了php庫TCPDF。 這是腳本:用TCPDF將空間寫入PDF文件
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Label Creator');
$pdf->SetTitle('labels');
$pdf->SetSubject('Labels di prova');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE,0);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// set font
$pdf->SetFont('times', '', 15);
//left margin
$pdf->SetMargins(18,15,18,FALSE);
// add a page
$pdf->AddPage();
$label="Hello world, i'm michele";
$pdf->Cell(0, 0 , $label, 0, 1, 'C', 0, '', 0,FALSE,'T','M');
//Close and output PDF document
$pdf->Output('../../labels.pdf', 'F');
echo 'Labels generate!';
的問題是,腳本工作,但在文件中我會看到不帶空格的文字!像這樣: helloworld,i'mmichele 有沒有人有解決方案?!!?
什麼是<<< EOD和EOD; ?? – trullallero
對不起,但$標籤=「你好世界,我是米歇爾」; $ pdf->單元格(0,0,$標籤,1,1,'C',0,'',3;不寫空格... – trullallero
我解決了,問題是瀏覽器的PDF插件可視化工具!! – trullallero