2010-10-20 90 views
2

hi 我想在php中創建一個pdf文件使用dompdf-0.5.1我從html創建這些文件我每次都有大量的數據我嘗試創建一個大文件其卡住給我的錯誤是therey,我可以使用較大的PDF文件從HTML 也是其爲小型和普通文件的工作 感謝html to pdf非常大的文件php

Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame not found in cellmap' in E:\AppServ\www\test\include\cellmap.cls.php:237 Stack trace: #0 E:\AppServ\www\test\include\table_cell_frame_reflower.cls.php(66): Cellmap->get_frame_position(Object(Table_Cell_Frame_Decorator)) #1 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Cell_Frame_Reflower->reflow() #2 E:\AppServ\www\test\include\table_row_frame_reflower.cls.php(70): Frame_Decorator->reflow() #3 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Row_Frame_Reflower->reflow() #4 E:\AppServ\www\test\include\table_frame_reflower.cls.php(468): Frame_Decorator->reflow() #5 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Table_Frame_Reflower->reflow() #6 E:\AppServ\www\test\include\block_frame_reflower.cls.php(408): Frame_Decorator->reflow() #7 E:\AppServ\www\test\include\frame_decorator.cls.php(387): Block_Frame_Reflower->reflow() #8 E:\AppServ\www\test\include\table_cell_frame_reflower.cls.php(115): Frame_Deco in E:\AppServ\www\test\include\cellmap.cls.php on line 237

+0

這將有助於有一些示例HTML導致該問題。您可以考慮升級到DOMPDF的0.6.0版本(目前處於測試階段)。它解決了包括這個問題在內的許多問題。 – BrianS 2010-10-20 18:07:06

回答

3
+0

+1這個選擇。大約一年前,我嘗試了所有可用的免費PDF轉換器,並且wkhtmltopdf比其他任何工作都更好。通常你會通過使用它來逃避許多問題和瘋狂的錯誤。 – 2013-11-28 14:16:11

2

建議更換任何庫只是有一些與進行頭撞,並發現了一些關於此問題的解決方法,所以我想分享一下。

dompdf Frame not found in cellmap錯誤可以通過編輯includes/cellmap.cls.php和註釋掉的每一次出現可以幫助:

throw new DOMPDF_Exception("Frame not found in cellmap"); 

線212,231,257,274

與代:

return false; 

這使我能夠看到我的多頁PDF文檔實際上發生了錯誤。我將其縮小爲跨越多個頁面的大圖像(當然用戶輸入爲cms!)因此,我將奇異圖像換成了相同的圖像,切成2塊,所有圖像都是固定的。

我也讀過,這個錯誤可以鏈接到div的跨越多一個頁面,但發現在0.6.0測試版3不是這樣,因爲任何'修復'周圍,沒有什麼區別,即使我有多個div跨頁。修復建議用'p'或'span'標籤替換所有div。

所以現在DOMpdf是呈現出CMS沒有問題產生的網頁,並希望這有助於一路走來一個人,

+0

謝謝你。我的這個錯誤讓我頭痛很久。在我的情況下,這是一個由於在一個對象中將對象更改爲數組而導致的PHP錯誤。 PHP錯誤顯示不適合頁面,因此錯誤。通過評論這些線我找出了幾乎無法察覺的錯誤。 – 2015-10-16 17:29:43

0

我已經與行跨度和列跨度面臨同樣的問題好幾天,在一個巨大的表,但沒有border-collapse:collapse(有一個與該屬性相關的已知問題)。

我已經加入這個我表元素的樣式,解決它:

table 
    { 
     border-collapse:unset; 
    } 

希望它能幫助!