基本問題:是否可以在將MultiCell放入文檔之前確定其高度?FPDF - 放置前確定MultiCell的高度?
原因:我的任務是創建PDF版本的表單。這種形式允許輸入文字,併產生可變長度。一個人我什麼都不輸入,另一個人可以寫幾個段落。 「那些權力」不希望這個文本在頁面之間斷開。
目前,在放置每個塊之後,我檢查頁面上的位置,如果我接近結尾,則創建一個新頁面。
if($this->getY() >= 250) {
$this->AddPage('P');
}
大多數情況下,這是有效的。但是有些少數鬼鬼祟祟的人進來了,比如249,然後有大量的文字。看起來在確定塊的高度之前先確定一個塊的高度是否更合理,然後才能確定它是否真正適合頁面。
當然,一定有辦法做到這一點,但谷歌搜索並沒有證明非常有幫助。
編輯澄清:表格提交後生成PDF。不是一個活躍的,可編輯的PDF格式...