I have solved the problem. Even though the way i solved is very rough. Need to work more to get a proper solution.
To do so, I have followed the instruction given in
this link. This link is completely in Japanese. Trust me I dont understand Japanese either. I used google translator to understand it.
To do so, you will need several things.
1. The full font. Download it from internet(I googled MS Mincho. its size was 7.8 MB or something close)
2. download TCPDF. You may ask "why? its already with PHPExcel.". Yes it is true. But that portion dont have all the tools. It only have required tools that it needed.
3. Now follow the instruction listed in
Even though all is described very will, I will give a little discription
i) extract the TCPDF
ii) move the dowloaded ttf file to
open command promt go to TCPDF directory. in my case it was C Drive root directory(I used it in windows)
iv) change your directory to
In my case C:/tcpdf/fonts/utils. (sorry later I found the tools are available :) )IN
the directory you will get ttf2ufm.exe for windows and
ttf2ufm(I guess for linux)
Now from command prompt use the command below: The font file name was ms-mincho.ttf
>ttf2ufm.exe -a -F
Three file will be generated(in my case i got lots of warnings. I dont know what to do with that). But Its working. so I ignored it.
there is a php file in the current directory name
Now do the command below
>[complete path of PHP]\php.exe ms-mincho.ttf ms-mincho.ufm 0
in my case the path is C:\Program Files\EasyPHP-5.3.3\php\php.exe
It created a file name ms-mincho.php in the same directory. now you have four file name with
Move all the file to [ the installtion directory of PHPExcel ]/Classes/Shared/PDF/fonts/ directory. in my case
But in my system I have moved out PHPExcel directory from Classes. So dont get confused.
Now, Your font is ready to use.
PHPExcel is not well defined yet to use font or may I just dont know how to do it. But I have found my own way with my limited knowledge and intelligence.
Open PHPExcel\Writer\PDF.php with some suitable php editor. Find the line
$pdf->SetFont($this->_font) if you print this line for test purpose you will see that the value is showing
To fix my problem. I did deal with the whole thing. I just change only
$pdf->SetFont($this->_font) to $pdf->SetFont('ms-mincho').
It solved my problem. Now I can see the proper japanese in my PDF file.
I did this because I need both xls and pdf file on some certain format so I needed this.
If you have better solution please let me know.