spipu / html2pdf

OFFICIAL PROJECT | HTML to PDF converter written in PHP
http://html2pdf.fr/en/default
Open Software License 3.0
1.67k stars 745 forks source link

Problem with special chars not on first page #486

Open poitierjohan opened 5 years ago

poitierjohan commented 5 years ago

Hi all,

I generate a PDF file with this bundle. All works worrectly but not for the specials chars (like é è à, ... - french content) BUT not on the first page !

I compil a pdf from different code like : $this->pdf->writeHTML($myFirstHtml); $this->pdf->writeHTML($mySecondHtml); $this->pdf->writeHTML($myThirdHtml);

No problem on my first page ($myFirstHtml). But on the second and thirs, all my special chars (é è à, ...) are replace by "??"

If I generate 3 pdf separatly, no problem !

Encoding : UTF-8 (DB and HTML)

How can I resolved this problem ?

Thank you for yours answers...

LittleBigFox commented 5 years ago

Hi!

$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8');

The fifth arg of the constructor is the encoding, have a try?

Regards, LBF

poitierjohan commented 5 years ago

Hi, Yes I have this arg.

Le mer. 26 juin 2019 à 09:07, LittleBigFox notifications@github.com a écrit :

Hi!

$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8');

The fifth arg of the constructor is the encoding, have a try?

Regards, LBF

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spipu/html2pdf/issues/486?email_source=notifications&email_token=AEVZPK346ET6HFT432AXYJDP4MIRRA5CNFSM4H3GGGHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYSR5JA#issuecomment-505749156, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVZPK4AEBDXLHJ5UPSJTEDP4MIRRANCNFSM4H3GGGHA .

LittleBigFox commented 5 years ago

I'm french too and i don't have this kind of problems...

Can you send the full pdf generation, without html content? On github or by mail?

poitierjohan commented 5 years ago

I can send a pdf by email. I will mask some informations.

Can i have any contact information ?

Le mer. 26 juin 2019 à 10:07, LittleBigFox notifications@github.com a écrit :

I'm french too and i don't have this kind of problems...

Can you send the full pdf generation, without html content? On github or by mail?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spipu/html2pdf/issues/486?email_source=notifications&email_token=AEVZPK7GOB524KT4BIOGSQ3P4MPTNA5CNFSM4H3GGGHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYSWRNQ#issuecomment-505768118, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVZPKZFJJRAYWFISTGJOEDP4MPTNANCNFSM4H3GGGHA .

com-xuonghuynh commented 5 years ago

I have same problem here

poitierjohan commented 5 years ago

My solution :

$html = $myFirstHtml . $mySecondHtml.. $myThirdHtm; $this->pdf->writeHTML($html);

in place of

$this->pdf->writeHTML($myFirstHtml); $this->pdf->writeHTML($mySecondHtml); $this->pdf->writeHTML($myThirdHtml);

On each $my...Html : My html content.