DOMPDF Error FIXED -  Frame not found in cellmap

Another quick post to help other PHP developers who might be running into this problem with DOMPDF...

DOMPDF - a useful PDF library

I often use DOMPDF for PDF generation from my PHP based applications and it's great, particularly as it interfaces well with CodeIgniter. It's also easier than some other PDF libraries, as you can simply send an HTML file to it and it will do the conversion to PDF format. The only problem is that you have to be careful how complex your HTML layout is. In fact I've found the simpler, the better (and yes, that means the use of HTML tables quite often).

The Error

One problem I've run into is this error:

Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame not found in cellmap' in /home/xxxx/public_html/system/plugins/dompdf/include/cellmap.cls.php:237

The Fix

I didn't see what was wrong immediately, but I soon found out that the reason this error was occurring was because I had a DIV tag that was spanning onto two pages. The fix was super easy; I simply changed the DIV tag to a SPAN.

This also seems to occur with <strong> tags; again I replaced these with a span tag.

Hope this helps other PHP developers!



Comments

blog comments powered by Disqus