我使用TCPDF生成需要PDF格式的计划。但我的文字并没有显示在生成的PDF上。我做了一些HTML验证,HTML似乎是有效的。关于可能出错的任何指示?
PDF文件:https://www.dropbox.com/s/42s6cyi0dzawcto/pdfschedule_March_2015_f1e4e194a7f32e2.pdf?dl=0
HTML片段:
<table cellpadding="5" cellspacing="0" class="calendar">
<tr class="calendar-row">
<td style="background-color: #DDD; border:1px black solid;" class="calendar-day-head">Sunday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Monday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Tuesday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Wednesday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Thursday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Friday</td>
<td class="calendar-day-head" style="background-color: #DDD; border:1px black solid;">Saturday</td>
</tr>
<tr class="calendar-row">
<td style="vertical-align:top; border: 1px solid black;">March 15, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 16, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 17, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 18, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 19, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 20, 2015<br/></td>
<td style="vertical-align:top; border: 1px solid black;">March 21, 2015<br/></td>
</tr>
<tr>
<td style="vertical-align:top; border: 1px solid black; background-color: #fae3e3;" colspan="7"><span
style="background-color: #fae3e3;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=29">Asr123 Ø£Øمر
غامق </a></span><br/></td>
</tr>
<tr>
<td></td>
<td style="vertical-align:top; border: 1px solid black; background-color: #fdf1ba;" colspan="1"><span
style="background-color: #fdf1ba;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=33">عربي</a></span><br/>
</td>
</tr>
<tr>
<td></td>
<td style="vertical-align:top; border: 1px solid black; background-color: #d1e8ff;" colspan="1"><span
style="background-color: #d1e8ff;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=34">5555</a></span><br/></td>
</tr>
<tr>
<td></td>
<td style="vertical-align:top; border: 1px solid black; background-color: #d1e8ff;" colspan="5"><span
style="background-color: #d1e8ff;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=36">apple juce</a></span><br/>
</td>
</tr>
<tr>
<td></td>
<td style="vertical-align:top; border: 1px solid black; background-color: #d1e8ff;" colspan="5"><span
style="background-color: #d1e8ff;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=39">NEW ROLL
PC1001</a></span><br/></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="vertical-align:top; border: 1px solid black; background-color: #fae3e3;" colspan="1"><span
style="background-color: #fae3e3;"><a style=" font-size:9pt; margin-left:5px; text-decoration:none;"
target="_blank" href="index.php?id=35">No
Description</a></span><br/></td>
</tr>
</table>
PHP代码段:TCPDF配置
$pdf = new TCPDF("L", PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor( 'AUTHOR');
$pdf->SetTitle('TITLE');
$pdf->SetSubject('SUBJECT');
$pdf->SetKeywords('KEYWORD');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 018', PDF_HEADER_STRING);
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$lg = Array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'ltr';
$lg['a_meta_language'] = 'fa';
$lg['w_page'] = 'page';
$pdf->setLanguageArray($lg);
$pdf->SetFont('dejavusans', '', 10);
$pdf->SetMargins(10, 5, 10);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->setCellHeightRatio(1.25);
$pdf->setFontSubsetting(false);
$pdf->AddPage();
$pdf->WriteHTML($html, true, 0, true, 0);
$pdf->Output( 'pdf/' . $file , 'D');
请注意,$ scheduler对象已经被实例化并且工作正常,其中返回上面发布的HTML输出。