PDF export problem

dimoss

Well-Known Member
Hi

I am trying to export a list to pdf but I get this error:

Warning: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified in /home/xxxxxx/public_html/j3x/libraries/dompdf/include/dompdf.cls.php on line 422
Unable to stream pdf: headers already sent

I use the default template which is the bootstrap template. The strange is that at the beginning it worked ok but when I tried to copy the files to make a new template and remove the intro then it destroyed somehow.

I reverted everything as it was but I continue to get the error.

Any ideas?

Thanks!
 
in libraries/dompdf/include/dompdf.cls.php
can you replace lines 421-423:

PHP:
 if ($encoding !== 'UTF-8') { 
        $str = mb_convert_encoding($str, 'UTF-8', $encoding); 
      }

with

PHP:
 if ($encoding !== 'UTF-8') {
echo "encoding = $encoding";
          $str = mb_convert_encoding($str, 'UTF-8', $encoding); 
      }

then reload the page and report back what $encoding it is trying to use

thx
 
odd - there shouldn't be a ";" at the end of the string, so that might be why its blowing up.
I think i have fixed that, although I have a feeling we (and the dompdf library itself) are a long way from being perfect
 
I've seen this error if the list (HTML table) needs more than one page.
I think this is also what your link is saying.
I don't know where this xould be done ->
Oh yeah... Yariv's fix has a slightly hard-to-see commented line. You only need to add:
while($child->get_node()->getAttribute("dontbreak"))
{
$child =$child->get_prev_sibling();
}
 
Hi again

The problem is sure with the table splitting on different pages.
I copied the F 2.5 default list template and make it as a pdf template for my purpose.
I put the size to a3 and portrait and it worked. However when I turned it to a4 i got the same error which means it cannot handle the table splitting somehow!!

The other problem with dopdf is that in large tables blows out the server memory.
Maybe the mpdf would be a better solution to integrate with fabrik.
 
that blogs for an old version of dompdf.
Have you tried increasing the paper size?
Not really likely that we swap pdf libraries to be honest, each one has its own weaknesses. DomPDF is the best one I've seen.
 
Hi Rob

Yes I tried to put it in a3 and works for one page. When it comes to two pages then the problem begins.
There is also the problem with the allocated memory.

The strange is that in F3.0.x it works on multiple pages also wto problem. But in F3.1.x it doesn't. I don't know why even if I tried to export to a F3.0.x template
 
It isn't working in 3.0 either;
minimal fabrik list template default.php (setting: a4, landscape)
Code:
<div style="height:5cm; background:green">
test
</div>
is working (but needs looong time)
height:25 cm (-> more than one site) is breaking with
Fatal error: Maximum execution time of 60 seconds exceeded
(different code lines)

Same with span (5cm ok, 25 breaking)
Code:
<span style="height:25cm; background:green;display:block">
test
</span>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top