• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pdf export with unicode using mpdf

#1
[eluser]Bigil Michael[/eluser]
I have completed pdf export with malayalam font (indian) statically, using mpdf. When I read contents from database only square boxes are printing. Can any one help me ??

Code given below

Code:
$data['description'] = 'ആ സമയത്താണ് തമിഴിലെ സൂപ്പര്‍ ഹിറ്റ് ' ;
  $html = $this->load->view("admin/authors/test",$data,TRUE);
  $this->load->library('mpdf57/mpdf');
  $this->mpdf=new mPDF('utf-8','A4','','',32,25,27,25,16,13);
  $this->mpdf->WriteHTML($html,2);
  $this->mpdf->Output('mpdf.pdf','I');
It runs successfully

Code:
$row =   $this->Authors_model->get_selected($selected_authors);
  $data['description'] = entities_to_ascii($row->description);  
  $html = $this->load->view("admin/authors/test",$data,TRUE);  
  $this->load->library('mpdf57/mpdf');
  $this->mpdf=new mPDF('utf-8','A4','','',32,25,27,25,16,13);
  $this->mpdf->WriteHTML($html,2);
  $this->mpdf->Output('mpdf.pdf','I');
It prints square boxes


database like this
Code:
മല

Can any one help me to solve this issue......

#2
[eluser]Bigil Michael[/eluser]
bump....

#3
[eluser]Bigil Michael[/eluser]
any help............

#4
[eluser]Tpojka[/eluser]
Code:
ascii_to_entities()
from text helper can't do that?

#5
[eluser]Bigil Michael[/eluser]
already tried this but the result is same.

#6
[eluser]Otemu[/eluser]
Hi,

If you can render "font (indian) statically, using mpdf" is the data exactly the same when you tried statically as it is stored in the database??

#7
[eluser]Bigil Michael[/eluser]
when i echo the contents both are same. but when i check using page source it shows difference,
extra contents are updated like this

Code:
<p align="JUSTIFY"><span  karthika; font-size: medium;">ഇത് ഒരു ടെസ്റ്റ്&zwnj; വർക്ക്&zwnj; &nbsp;ആണ്&nbsp;</span></p>

#8
[eluser]Otemu[/eluser]
Try

Code:
$row =   $this->Authors_model->get_selected($selected_authors);
  $data['description'] = $row->description;

or try
Code:
$row =   $this->Authors_model->get_selected($selected_authors);
  $data['description'] = html_entity_decode($row->description);

instead of

Code:
$row =   $this->Authors_model->get_selected($selected_authors);
  $data['description'] = entities_to_ascii($row->description);

#9
[eluser]Bigil Michael[/eluser]
I tried these 3. first and last shows the result as blocks
second one shows error like this

Code:
HTML contains invalid UTF-8 character(s)

Research Pdf

ഇത് ഒരു ടെസ്റ്റ്‌ വർക്ക്‌ [[#160]]ആണ്[[#160]]

mPDF error:

#10
[eluser]Otemu[/eluser]
Am not sure, upload the code including db backup and I take a look for you


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.