Zunenonooo / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

DOMPDF fails when PHP uses Brazilian Portuguese locale #518

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
How to reproduce:

- Use this statement to set locale to Brazilian Portuguese:
  setlocale(LC_ALL, 'ptb');

- Generate a PDF using the class directly:
  $dompdf = new DOMPDF();
  $dompdf->load_html('<html><body>Hello</body></html>');
  $dompdf->set_paper('letter', 'portrait');
  $dompdf->render();
  $dompdf->stream("dompdf_out.pdf");

Expected: 
  A download prompt for a well formed PDF file. Well, the download prompt appears, and the generated PDF can be opened, but there's no content, and no error. It seems something is silently failing and no content is generated.

Issue happening on PHP 5.4.3, DOMPDF 0.5.2, on Windows XP SP3. 

It took me many hours to figure out what was going on. DOMPDF is crearly using 
locale-dependent formatting functions to produce content. Any code like this 
must be made locale independent, since DOMPDF should be compatible with any PHP 
supported locale.

Thanks!

Eduardo

Original issue reported on code.google.com by e...@mvxsistemas.com on 19 Jul 2012 at 4:52

GoogleCodeExporter commented 8 years ago
This has already been addressed in the 0.6.0 code base. You should update to 
the latest beta. If that is not feasible, change your locale back to en-US 
before rendering your document in dompdf.

Original comment by eclecticgeek on 19 Jul 2012 at 3:18

GoogleCodeExporter commented 8 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16