我想只在第二页添加换行符。 这是生成的pdf链接 https://www.docdroid.net/pjvfJPn/10020.pdf.html。这是我在CodeIgniter中的代码
$this->load->library('m_pdf');
$pdf = $this->m_pdf->load();
$pdf2 = $this->m_pdf->load();
$pdf->WriteHTML($html);
$data['total_page_number'] = $pdf->page;
$pdf->DeletePages();
$pdfFilePath = FCPATH."pdf/" . $file_name;
$returnPath = "pdf/" . $file_name;
$html2 = $this->load->view('projects/pdf/projects_pdf', $data, true);
$footer_html = dashboard_lang('_CONTRACT_PDF_END_TEXT');
$header_html = $this->load->view('projects/pdf/header_text', $data, true);
$pdf2->SetHTMLHeader( $header_html );
$pdf2->setHTMLFooter($footer_html);
$pdf2->AddPage('', '', '', '', '', 15, // left
3, // right
48, // top
16, // bottom
5, 2); // footer bottom
if ($download_pdf) {
$pdf2->WriteHTML($html2);
$pdf2->Output('' . $file_name, 'D');
}
答案 0 :(得分:0)
\n
是您可以添加中断的方式。
$pdf->InsertText('Rakesh\n\nKumar');
试试这个。感谢