fpdf

Inserting line breaks into PDF

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 11:28:51
问题 I\'m generating some PDF file on the fly using PHP. My problem is I need to insert line breaks in some part of the text that will be inserted in the PDF file. Something like: $pdf->InsertText(\'Line one\\n\\nLine two\'); So it prints: Line one Line two I know \\n doesn\'t work on PDF, but do you guys know any character or something that represents a line break on these files? 回答1: If you are using fpdf, in order to be able to use line breaks you will need to use a multi-line text cell as

FPDF utf-8 encoding (HOW-TO)

旧城冷巷雨未停 提交于 2019-11-26 01:15:58
问题 Does anybody know how to set the encoding in FPDF package to utf-8? Or at least to ISO-8859-7 (Greek) that support greek characters? Basically I want to create a pdf file containing greek characters. Any suggestions would help. George 回答1: Don't use UTF-8 encoding. Standard FPDF fonts use ISO-8859-1 or Windows-1252. It is possible to perform a conversion to ISO-8859-1 with utf8_decode() : $str = utf8_decode($str); But some characters such as Euro won't be translated correctly. If the iconv