I have problem when parse Fraction to DOMPDF.
I've changed the font-family to DejaVu Sans, Roboto, and Helvetica Neue, Helvetica but it doesn't affect the resulting PDF
By DB:
HTML Entities => enter image description here => ⅐
Result PDF:
Use font-family 'times' => '?'
Use font-family 'dejavu sans' => (whitespace)
Use font-family 'roboto' => (square empty)
Help me, guys!
I change PdfGenerator.php, edit file HTML for generate to DOMPDF, Have used mbstring_encryption_encode, utf8_decode
Related
Myself trying to generate pdf files in Kannada font using fpdf and php as,
require_once('fpdf/fpdf.php');
$pdf = new FPDF();
$pdf->AddFont('Baraha','','baraha.php');
$pdf->AddPage();
$pdf->SetFont('Baraha','',35);
$pdf->Write(10,' cheluva kannaDa nADu');
$pdf->Output();
Tried using baraha.ttf, tunga.ttf, lohit.ttf etc but every font gives jumbled output. Below is the output for baraha.ttf font for the above line. How to output correctly in Kannada?
In Braraha font:
In Lohit Font:
Followed both this and this tutorials.
EDIT: The correct Kannada sentence is ಚೆಲುವ ಕನ್ನಡ ನಾಡು for cheluva kannaDa nADu. Also please suggest other fonts for correct Kannada sentences. FYI, the same jumbled words are appearing in the case of tcpdf php library and pdfmake.js javascript library as well. So can anyone please suggest a best library (either javascript or php) for pdf generation.
I have developed the website in codeigniter, now i want to add tamil fonts in my website .
Type the description in tamil, and add the description value into the description table desc colum and retrieve the desc values and display that tamil content to my website..
You can do it with CSS3!
Before the functionality didn't actually exist beyond having the font pre-installed. Tamil fonts are unicode and often are ttf files. So make sure you have the ttf file on your web-server in order to have it available for use.
<style>
#font-face
{
font-family: myTamilFont;
src: url(tamil_font.ttf);
}
div
{
font-family: myTamilFont;
}
</style>
This will not work IE8 and below
For more information: http://www.w3schools.com/css3/css3_fonts.asp
Similar question asked on StackOverflow: How to embed fonts in HTML?
Use meta tag char set utf8 for using tamil font...
for insert database you should use ..
mysql_query ("set character_set_results='utf8'");
Hope this will help you
I'm trying to find out the capabilities and limitations of what i can actually do with imagemagick and would like to get some feedback on this.
What I ultimately want to do is use imagemagick to output images to the browser with custom ttf fonts in it, so that the user enters some text and it displays all the various images with the different fonts.
What are the limitations of imagemagick, can i specify the location of where to draw the fonts on the image, and will it display differently on different systems or browsers?
I will appreciate it if you can include anything else that I need to know about working with imagemagick, before i jump into this little project.
You should check imagemagick example page: http://www.imagemagick.org/Usage/
It is really powerful and there are so many you can do.
And yes, you can specify font convert -t a.ttf ...
You can definitely tell imagemagick the location of your text in the image and since it is generated on your server, it will be the same on any browser. The problem may be more how you are displaying those images (any css or javascript tricks ?)
The thing is that all those fonts will need to be installed on your server where the image is going to be created.
Check this about converting text to images: http://www.imagemagick.org/Usage/text/
Another useful command is convert -list font which will list the system fonts, their paths, and aliases. Very useful when porting scripts from one machine to another
convert -list font|grep -i arial
Font: Arial
family: Arial
glyphs: /Library/Fonts/Arial.ttf
Font: ArialB
family: Arial
glyphs: /Library/Fonts/Arial Bold.ttf
Font: ArialBI
family: Arial
glyphs: /Library/Fonts/Arial Bold Italic.ttf
Font: ArialBk
family: Arial Black
glyphs: /Library/Fonts/Arial Black.ttf
This makes it really easy to do things like bold or italicize with imagemagick.
convert -background none -fill black -font ArialB -pointsize 15 \
-size 380x caption:'i <3 stackoverflow' \
summary_text.png
I'm using TCPDF to create PDFs that include Japanese characters. Using the TrueType font ArialUni, most characters are displayed correctly, except the yen symbol shows up as a square box instead of ¥.
Here's a snippet of the resulting PDF using ArialUni:
So I tried another font. Here's the same section of the resulting PDF using GT200001:
And here's the same section using Helvetica:
Here's the same section using GNU's FreeSans:
I would like that second line to show up as "(渋谷猿, ¥8,000)"
I'm not surprised that Helvetica and Freesans cannot render the kanji correctly, but I cannot fathom why the other two fonts can render the kanji, but not the yen symbol, which is much more common.
The web server creating the PDFs is LAMP running Ubuntu. I'm viewing the PDFs on OS X with Chrome (using its in-browser view). I've also tried downloading the PDFs with Firefox and displaying in Preview. I get essentially the same results: ArialUni and GT200001 don't display the yen symbol, while Helvetica and Freesans don't display the kanji (but do display the yen symbol).
I know I can use different fonts for different lines/cells of the PDF, but the kanji and yen symbol are on the same line.
How can I get the kanji and yen symbol to display in a single line using TCPDF?
Near the top of my PDF code, I load the font using TCPDF's addTTFfont();
$this->font = $this->addTTFfont(K_PATH_FONTS.'arialuni.ttf', 'TrueTypeUnicode', '', 32);
Here's the code I'm using to write the section of the PDF.
$pdf->SetFont('arialuni','',10);
$pdf->MultiCell(105, $remarks_height, $remarks, 'B', 'L', false, 0, '', '', true, 1, false, true, $remarks_height, 'T');
In this wikipedia article you can read some more about this character.
Basically, there are 2 different ways of writing this Japanese Kanji, as it happens with some other symbols. From accepted answer "I was using ¥, not ¥", we can see that he was using the 'occidental' or Unicode ¥ symbol, when he actually wanted to use the double-width character ¥.
Oh dear, I figured it out.
I was using ¥, not ¥. Sorry for being confused!!
What I have noticed with TCPDF is, it's all about fonts.
I tried to use it for 15 totally different languages with different writing style too and only font I am using is Arial UNICODE MS.
TCPDF has function which will convert that font into TCPDF friendly files, which are arialuni.ctg.z(70k), arialuni.php(447k), and arialuni.z (14M).
the functions are,
http://www.tcpdf.org/fonts.php
$fontname = $pdf->addTTFfont('/path-to-font/ARIALUNICODE.TTF', 'TrueTypeUnicode', '', 32);
I have used dom pdf class in codeigniter to create html to pdf creation. But this dom pdf doesn't support turkish character. Is there any pdf plugin that support turkish character.
Thanks
Shylaja
To support the Turkish language in DOMPDF, a Turkish character uses the dejavu font
.turkish
{
font-family: 'dejavu sans';
}
download the font from below link
http://dejavu-fonts.org/wiki/Download
and copy to folder dompdf/lib/fonts
dom pdf support turkish character by using dejavu