Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorsilena
    • CommentTimeMar 9th 2010
     

    $mpdf=new mPDF('UTF-8','A4','','',15,15,44,15);
    $mpdf->SetAutoFont(AUTOFONT_ALL);
    $mpdf->SetDisplayMode('fullpage');

    $mpdf->SetHTMLFooter( '專用章' );
    $mpdf->SetHTMLHeader( '專用章' );
    $mpdf->WriteHTML( '專用章', 2 );

    $mpdf->Output($fileName,'I');




    As you can see, only the chinese in the body is correct,
    the header and footer is not correct.

    • CommentAuthorsilena
    • CommentTimeMar 9th 2010 edited
     
    the test chinese I use is:

    $mpdf->SetHTMLHeader( "\xE5\xB0\x88\xE7\x94\xA8\xE7\xAB\xA0" );
    $mpdf->SetHTMLFooter( "\xE5\xB0\x88\xE7\x94\xA8\xE7\xAB\xA0" );
    $mpdf->WriteHTML( "\xE5\xB0\x88\xE7\x94\xA8\xE7\xAB\xA0", 2 );

    in case you can not see it.
    • CommentAuthorIanBack
    • CommentTimeMar 10th 2010
     
    Thanks for highlighting 2 separate bugs! I will fix in next release, but this is the patch if you wish:

    function AutoFont($html) {
    .. near the end... edit the line marked with red

    // mPDF 3.0   
    $e = preg_replace('/[&]/u','&',$e);
    $e = preg_replace('/[<]/u','&lt;',$e);
    $e = preg_replace('/[>]/u','&gt;',$e);
    // mPDF 4.0
    $e = preg_replace("/(\xef\xbf\xb0span lang=\"([a-z\-A-Z]{2,5})\"\xef\xbf\xb1)\s+/",' \\1',$e);
    $e = preg_replace("/[ ]+(\xef\xbf\xb0\/span\xef\xbf\xb1)/",'\\1 ',$e);


    In function _puthtmlheaders() {
    Add the line marked in red.
    NB These lines occur twice in the same function
    // Writes over the page background but behind any other output on page
    $os = preg_replace('/\\\\/','\\\\\\\\',$os);
    $this->pages[$n] = preg_replace('/(___BACKGROUND___PATTERNS'.date('jY').')/', "\n".$os."\n".'\\1', $this->pages[$n]);


    • CommentAuthorsilena
    • CommentTimeMar 11th 2010
     
    thanks for the fix.