When I render jsreport pdf using phantom and html-to-pdf with character from russian, they become weird symbols. Is there any settings in jsreport or I need correct font in the server machine?
http://jsreport.net/learn/phantom-pdf
Phantom-pdf is currently not able to print some national characters by
default. To be able to print correct national characters into pdf you
need to set utf-8 charset in your html first.
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
Česko
</body>
</html>
Related
I am using Laravel 5.4 and barryvdh/laravel-dompdf plugin for dompdf. I am using this code,
Controller
$pdf = PDF::loadView('invoice');
View (invoice.blade.php)
<!DOCTYPE html>
<html>
<head>
<title>Invoice</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div>빨간색</div>
</body>
</html>
When using this code the japanese text will not show correctly. How do I fix this issue?
You can use this link for the answer. It is in japanese but you can use google chrome translate.
In Summary:
Download font file from http://ipafont.ipa.go.jp/old/ipafont/download.html or use any ttf files you want
Download load_font.php file from https://github.com/dompdf/utils to /vendor/dompdf/dompdf/
execute #php load_font.php ipag $path_to_font_directory/ipag.tt which will generate something like
Unable to find bold face file.
Unable to find italic face file.
Unable to find bold_italic face file.
Copying $path_to_font_directory/ ipag.ttf to $laravel_install_directory /vendor/dompdf/dompdf/lib/fonts/ipag.ttf...
Generating Adobe Font Metrics for $laravel_install_directory /vendor/dompdf/dompdf/lib/fonts/ipag...
Copy font files to storage #cp lib/fonts/* /storage/fonts/
Reference your font in css
body {
font-family: ipag;
}
I am developing a website which supports Thai language. Now i have the Thai data in my database which is proper, but when am trying to fetch the data and display in my view, some junk content is being displayed like this À¹À¸ŸÀ¸¥À¸ŠÀ¹„À¸”À¸£À¹ŒÀ¸Ÿ À¸„À¸´À¸‡À¸ªÀ¹ŒÀ¸•À¸±À¹‰À¸
The content is displayed properly when i write a core PHP script and echo it.
In my db i have used collation : utf8_general_ci
In codeigniter's application/config/database.php i have the following configuration.
$db['livedb']['char_set'] = 'utf8';
$db['livedb']['dbcollat'] = 'utf8_general_ci';
And in the header view am using <meta charset="utf-8" />
Please help me where am i going wrong. Thanks for help in advance.
You should use utf-8 meta in your view
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Have you got the meta tag for displaying UTF8 in your head tag
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I'm trying to render a webpage in Explorer as IE8, since IE9 is doing a great mess with CSS and not showing the #font-face.
I read the Microsoft Documentation here: http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx and other related topics like IE9 does not at all care about 'X-UA-Compatible' meta tag and Force IE9 to emulate IE8. Possible? and none resolved my issue, either I am very dumb (witch can be) or I can't find the problem.
The webpage is: karactermania.com/web2012/betty and I'm using the CMS Textpattern to build it.
I tried with:
<!-- Enable IE8 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<!-- Enable IE8 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE8" /> (as I found some examples written with and without the "=")
<!--[if IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE8" >
<![endif]--> (desperate attempt)
Complete HTML declaration:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE8" />
If anyone can point where the error is and how can I fix it, will earn my eternal gratitude :)
Thanks
I had the same problem as you. My X-UA-Compatible header was ignored. I found the solution in this post
The x-ua-compatible header has to be in the head section, before all other elements except for the title element and other meta elements
First time poster and hoping to solve a very frustrating issue.
In Google chrome, my PHP site displays random characters such as Â. However, when I switch the encoding to UTF-8 all the random characters clear up.
I've been reading elsewhere that that I need to tell me site to use UTF-8 by default. My host say this is already enabled on their side.
What code do I add and where to solve this issue?
Put:
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
In the <head> of the document, and it should force the page to render utf-8 characters properly.
Further description: In your HTML page, you would have the page layed out as such:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
<!--<link> tags for any CSS-->
<!--<script> tags for any JS-->
<!--Anything else in the head-->
</head>
<body>
<!--Page contents-->
</body>
</html>
i have written my HTML code with the meta datas of
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
meta http-equiv="Content-Type" content="text/html; charset=utf-8"
meta http-equiv="cache-control" content="NO-CACHE"
meta http-equiv="content-language" content="pt"
it is in UTF-8 format but when i opened this page in IE6 browser the encoding type is western european(ISO) so it shows portuguese language as informação originaly the string is informação
what could be the problem
please guide me
The problem is IE6. Ask any web developer.
Anyway, you'd better concentrate on newer browser versions, there's no use wasting your time with IE6 because you won't learn anything other than that it implements its own standards, which is absolutely not useful.