0

I am using the FPDF library to generate a pdf, I want to write Hindi and Marathi text in that but it display's only English text. I tried adding 'Devnagari' fonts using makeFont.php but still it doesn't work.Below is my code that adds text to a pdf

     $pdf->SetXY(0,210);
     $pdf->SetLeftMargin(28);
     $pdf->SetRightMargin(28);
     $pdf->AddFont('mangal','','mangal.php');
     $pdf->SetFont('mangal','',11);
     $pdf->Write(2,'खालील आपली भाषा');

This is what I am getting in PDF

amar
  • 175
  • 3
  • 19
  • Checkout http://stackoverflow.com/a/21530540/1023432 – Ananth Apr 18 '17 at 12:45
  • Possible duplicate of [FPDF utf-8 encoding (HOW-TO)](http://stackoverflow.com/questions/6334134/fpdf-utf-8-encoding-how-to) – Veve Apr 18 '17 at 13:04
  • I already have a pdf file and I want to use it as a source file in iFPDF library. I tried accessing it like this $pdf->setSourceFile('Section-478(1)30.pdf'); but its not working.Is there any way to make it work. – amar Apr 19 '17 at 06:24

1 Answers1

3

I hade the same problem some years ago. I used then tFPDF and it solved the issue.

You may want to try it? The tFPDF class-file and an example are provided there: http://www.fpdf.org/en/script/script92.php

Have a nice day

Allan Karlson
  • 453
  • 11
  • 23
  • I already have a pdf file and I want to use it as a source file in iFPDF library. I tried accessing it like this $pdf->setSourceFile('Section-478(1)30.pdf'); but its not working. – amar Apr 19 '17 at 05:42
  • Sorry, what do you mean with iFPDF. Is that somethink with php? Do you have a weblink where I can download it so see what you mean? – Allan Karlson Apr 19 '17 at 09:38
  • sorry I mean tFPDF library that was typo – amar Apr 19 '17 at 09:40
  • Sorry, I did not do that before, so I suggest that you somehow write a new question with that topic because it is a kind of new question – Allan Karlson Apr 22 '17 at 10:07