i can't get characters like ų ė to show up, instead they become
question marks.
can somebody help me out with this?
Which version of DOMPDF? The default character set available is fairly
limited (i.e. a subset of Windows-1252). There are two methods of
increasing character set support:
1) use a differences array
2) use DOMPDF 0.6.0 alpha 2, enable unicode, add a new font using
load_font.php
The first option is somewhat complex because you are essentially using
character replacement. Unfortunately, it's your only option with
DOMPDF 0.5.1. Luca Priorelli has a pretty good post about how to do
this: http://luca.priorelli.com/
The second option can also be somewhat complex, because you have to
ensure that ttf2ufm (ttf2pt1 modified with Unicode support) is running
on your system. Beyond that, though, it is a much better option.
I've tried adding a new font.. but i'm getting nowhere :/
can someone help me with this? how exactly do I make the font? how do
I include it and us it the right way?
Thanks
What OS are you using? Currently ttf2ufm (which you need in order to
install new fonts) only works on linux systems. If you're on a linux
system you will also need shell access. You can't install a new font
over the web.
Briefly, here are the steps:
1) ensure your system has ttf2ufm
2) configure dompdf_config.inc so that TTF2AFM points to the ttf2ufm
executable
3) ensure that the font file is in an accessible location
3) execute load_font.php as described in the documentation
The documentation related to font installation can be found here:
http://code.google.com/p/dompdf/wiki/Installation
Also, i'm trying to add the Times font with character support, after i
convert the font, how do i include it properly for use?
And.. If i try to use the conversion array thing, how do i specify new
characters? I need ęėįūšžč, or are they in the array? And .. Do i have
to change that string in 4 places along with the array?
Thanks
The files produced by load_font.php should be portable. So if you want
to set it up on linux and copy to your Windows system you should be
able to do so. Also note the recent release of a web-based tool to
prepare the fonts for you. See the following post:
http://groups.google.com/group/dompdf/browse_thread/thread/9f7bc0162b04d5cf
I'm not sure what will happen if you use the Times font since it is a
core font, but it doesn't hurt to try. After you install a font, you
only need to reference it in your CSS using the name you supplied
during installation. If specifying "Times" doesn't work you could
always install with an alternate name like "Times Expanded" or
something like that.
Take a look at this post on Luca's site for directions on using the
differences array. If you decide to give it a try, but you're still
having problems, let me know and I'll try to help you out more. I
haven't used this particular feature, so it's something I'll need to
research more.
http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/
You probably can use the files produced by tcpdf, but I'm not familiar
enough with the output to say for sure. This is probably something
that is worth us looking into. In the meantime, however, maybe the new
web-based tool can help you out:
http://groups.google.com/group/dompdf/browse_thread/thread/9f7bc0162b04d5cf
How do I correctly specify the font? my current setup is:
$output='
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
body
{
padding: 2cm 1cm 2cm 3cm;
font-family: "Times Custom";
}
</style>
</head>
<body>
ąčęėįšųūž
</body>
</html>';
$dompdf = new DOMPDF();
$dompdf->load_html($output);
$dompdf->render();
$dompdf->stream("test.pdf", array("Attachment" => 0));
> web-based tool can help you out:http://groups.google.com/group/dompdf/browse_thread/thread/9f7bc0162b...
This should work. I've done something similar here (I just used
verdana, but called it "times new" for load_font.php):
http://eclecticgeek.com/dompdf/index.php?&input_file=bd0ea178b0779227.htm&dompdf_ver=trunk&load_method=1
Have you enabled unicode support in dompdf_config.inc.php?
How do i set the unicode encoding?
> --
> You received this message because you are subscribed to the Google
> Groups "dompdf" group.
> To post to this group, send email to dom...@googlegroups.com.
> To unsubscribe from this group, send email to dompdf+un...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/dompdf?hl=en
> .
>
For reference:
http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php#147
On Mar 2, 12:43 am, CodilX <cod...@gmail.com> wrote:
> Thank you for the reply :)
>
> How do i set the unicode encoding?
>
> >http://eclecticgeek.com/dompdf/index.php?&input_file=bd0ea178b0779227...
I think you should put this step-by-step "tutorial" somewhere in the
FAQ or something, it was really confusing when I started using dompdf
in the first place, and then stumbling across this character
problem..
but thankfully it works, thanks again. awesome!!
On Mar 2, 8:05 am, BrianS <eclecticg...@gmail.com> wrote:
> Find the DOMPDF_UNICODE_ENABLED entry in dompdf/dompdf_config.inc.php.
>
> For reference:http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_con...
http://dompdf.googlegroups.com/web/utf8_verdana_custom.pdf
http://dompdf.googlegroups.com/web/utf8_times_custom.pdf
On Mar 2, 2:44 am, CodilX <cod...@gmail.com> wrote:
> actually.. i jumped the gun - it isn't working. some of the letters I
> posted are rendered correctly, but the other letters.. take a look:
>
I've used the online tool you posted.
The fonts can't be corrupted, I'm using the ones in the windows/fonts
folder.
Could you upload the converted fonts you're using? Times would be great
On Mar 2, 8:48 am, CodilX <cod...@gmail.com> wrote:
> Yeah I also found it weird that the text copies itself correctly.
>
> I've used the online tool you posted.
>
> The fonts can't be corrupted, I'm using the ones in the windows/fonts
> folder.
>
> Could you upload the converted fonts you're using? Times would be great
>
The tool isn't even close to being fixed, but I'm hoping the change I
made will at least work around this problem.
On Mar 2, 1:25 pm, CodilX <cod...@gmail.com> wrote:
> sure, here they arehttp://groups.google.com/group/dompdf/web/dompdf_fonts.zip
http://dompdf.googlegroups.com/web/utf8_working.pdf
thank you again for your awesome help, and for an awesome product!
when i've uploaded the files to my test server, i get this error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 24 bytes) in /var/www/vhosts/test.domain/httpdocs/dompdf/lib/
class.pdf.php(2515) : eval()'d code on line 68615
These pages provide all the information on increasing the memory limits:
http://drupal.org/node/207036
http://www.ducea.com/2008/02/14/increase-php-memory-limit/
You might also want to upgrade to the latest versions of dompdf and PHP
if possible, as they may be more memory efficient.
Paul
--
Paul Waring
http://www.pwaring.com
i've yet to solve this problem, my client has only regular hosting
with no access to php.ini .. hate hosts..
On Mar 3, 12:09 pm, Paul Waring <p...@xk7.net> wrote:
> This is a common problem with dompdf - you need to either increase the
> maximum amount of memory available to PHP or generate your PDF one page
> at a time and then stitch them together into one document.
>
> These pages provide all the information on increasing the memory limits:
>
> http://drupal.org/node/207036http://www.ducea.com/2008/02/14/increase-php-memory-limit/
now another issue.. the file size is incredibly large for the content
in the files. a pdf with only one page with little text, no images is
about 1.5mb in size. two pages are 2.7mb or so. is there anyway to
decrease the size? it isn't really a big issue, but it would be great
if the files were smaller.
again, thanks for helping me :)
On Mar 3, 12:21 pm, CodilX <cod...@gmail.com> wrote:
> thank you :)
>
> i've yet to solve this problem, my client has only regular hosting
> with no access to php.ini .. hate hosts..
>
> On Mar 3, 12:09 pm, Paul Waring <p...@xk7.net> wrote:
>
> > This is a common problem with dompdf - you need to either increase the
> > maximum amount of memory available to PHP or generate your PDF one page
> > at a time and then stitch them together into one document.
>
> > These pages provide all the information on increasing the memory limits:
>
> >http://drupal.org/node/207036http://www.ducea.com/2008/02/14/increase...
Paul
I'm currently producing some documents in Japanese, everything looks
fine, but as CodilX was saying, the file sizes are a bit enormous.
http://groups.google.com/group/dompdf/browse_thread/thread/fc9c17f7f261d96d
Following that post, it seems like it ought to be fairly straight
forward to subset the font... except you have to understand how the
map works, and in my case understand a) which map to use for my
Japanese font, and b) how to actually figure out what subset I need.
Any helpful suggestions? :)
I see that you guys have added http://code.google.com/p/dompdf/issues/detail?id=135
to your plans, and in Japanese (and other Asian languages) I'm
imagining this could be quite painful.