SOLVED: Dompdf Error : Warning: mb_convert_encoding() [function.mb-convert-encoding]:

ontarget

Active Member
Hi
I am trying to get a pdf output using the dompdf 0-6-0beta 3 library I am using Joomla 3.2.0
The error I am getting is
Warning: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified in libraries/dompdf/include/dompdf.cls.php on line 412
Unable to stream pdf: headers already sent

Here is the code on those lines


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

Does anyone know the fix for this issue?
Thanks


 
Ok the solution everybody has been waiting for...
in the component/component_xxx/views/tmpl/default.php

Code:
<tr>
            <td width="100" class="key title_cell">
                <?php echo  JText::_('EB_EVENT'); ?>
            </td>
            <td class="field_cell">
                <?php echo $this->event->title ; ?>
                <div style="display:none;">&</div>
            </td>
        </tr>

The title which the pdf was being named didnt like certain characters so this was placed there <div style="display:none;">&</div>
 
Upgrade to joomla 3.3.6
The pdf output for my Event Booking pdf stops working
To fix the issue I
Unzipped the latest dompdf library https://github.com/Fabrik/fabrik/archive/joomla3.zip
Remove/rename your libraries/dompdf replace with new zip version

Replace line 3105 dompdf/lib/class.pdf.php




with
Code:
$output = ob_get_clean();
if ( headers_sent()) {
echo $output; }

Updated the copy of (in this case Event Booking) file from
components/com_eventbooking/views/registrant/view.html.php and created
components/com_eventbooking/views/registrantpdf/view.pdf.php


Updated
components/com_eventbooking/views/registrantpdf/tmpl/default.php
Code:
Line 2: ob_start();
Also make sure your code is tidy and remove any unnecessary spaces

It now works fine again!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top