[英]Output input text to pdf file
我正在使用FPDF和FPDI庫編輯pdf文件。 我創建了html文本並提交了輸入。 我想從html代碼中輸入文本並將其輸出到pdf文件中。 這是我的代碼:HTML:
<form action="send.php" method="post">
<input type="text" name="post_text" id="post_text">
<input type="submit" value="send">
</form>
PHP:
..
$text = $_POST['post_text'];
...
$pdf->Write(0,'$text');
...
然后,我寫類似hello, this is me
東西hello, this is me
在文本框中,並且我將$text
值輸出到我的pdf中。 但我希望該輸出是在文本框中編寫的文本嗎?
您將$text
打印為文本,如果要打印變量內容,則不需要引號。
$pdf->Write(0, $text);
您正在為PDF寫入分配常量字符串值,
$pdf->Write(0, '$text');
它需要$text
作為字符串。
嘗試:
$pdf->Write(0, $text);
它將$ text中的任何內容寫入pdf!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.