I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

HosSeinM

I use dompdf to save a html page as pdf by php. I use Persian characters in my html page (actually php page) but when i'm trying to save it as pdf, the export just looked like '?????' :( .I have searched all the net and I found a configuration for unicode characters https://github.com/dompdf/dompdf/wiki/UnicodeHowTo#configure-dompdf-for-unicode-support in "dompdf_config.inc.php" or "dompdf_config.custom.inc.php" file. but the problem is I CAN'T FIND such file in all of my dompdf folder and in all of my file system. Please somebody tell me where it is or what I must do. something else is that I have to use dompdf because of its fantastic CSS compatibility. Thanks.

This is Export. http://i.stack.imgur.com/nYAzW.png

This is my code.

require("dompdf/autoload.inc.php");
use Dompdf\Dompdf;
$dompdf = new Dompdf();
$dompdf->loadHtml("<html><head>
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">

<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/scorestyle.css\">

</head>
<body><div>
<div id=\"showscorediv\"><table><tbody><tr class=\"scoresubject\"><th colspan=\"2\">کارنامه ارزیابی</th></tr><tr class=\"scorecategory\"><th>شاخص ها</th><th>امیتاز ها</th></tr><tr><td><span class=\"level_0\">شاخص های کیفی</span></td><td class=\"scoretd\">62</td></tr><tr><td><span class=\"level_1\">شاخص های مرتبط با تیم کاری</span></td><td class=\"scoretd\">10</td></tr><tr><td><span class=\"level_1\">شاخص های مرتبط با محصول</span></td><td class=\"scoretd\">28</td></tr><tr><td><span class=\"level_1\">شاخص های مرتبط با بازار</span></td><td class=\"scoretd\">24</td></tr><tr><td><span class=\"level_0\">شاخص های کمی</span></td><td class=\"scoretd\">60</td></tr><tr><td><span class=\"level_1\">شاخص های تولیدی</span></td><td class=\"scoretd\">20</td></tr><tr><td><span class=\"level_1\">شاخص های درآمدی</span></td><td class=\"scoretd\">14</td></tr><tr><td><span class=\"level_1\">شاخص های هزینه ای</span></td><td class=\"scoretd\">26</td></tr><tr class=\"scoresubject\"><th>امتیاز کل</th><th>122</th></tr></tbody></table>
</div>
</div></body></html>");
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream();
BrianS

You appear to be using dompdf 0.7.0, which no longer uses the dompdf_config.inc.php configuration file. Unicode support is always enabled with this release.

To display the characters used in your sample code you need to ensure that:

  1. You are supplying a font that supports these characters (that appears to be the case).
  2. That dompdf has both read and write capability to the temporary directory, font directory, and font cache directory. You can set these using $dompdf->set_option('option', 'value'); (where option would be tempDir, fontDir, or fontCache).
  3. The font is accessible to dompdf and is in TTF format.
  4. You are correctly styling your content to use your font. Hard to know without seeing your CSS.

FYI, you can't just drop the TTF/UFM in your font directory. dompdf has to record information about the font in order to use it. Also, the AFM metrics file won't work in this case anyway because that indicates Windows ANSI encoding on the font. Windows ANSI encoding does not support the characters in your sample. Dompdf uses the UFM metrics format for Unicode support.

The utilities that were included with previous versions of dompdf are no longer included with 0.7.0. So long as you meet the requirements of using the @font-face declaration you don't need any external utilities. If needed, however, you can find a compatible version of the load_font.php script in the dompdf-utils project.

Since you are using 0.7.0 (which was just released) a lot of info on the Internet may be out of date, so you may want to read up on how to use it:


Lastly, dompdf includes a font (DejaVu) that can support your characters. Try adding the following to your stylesheet so that you have a fallback in case your custom font doesn't work:

* { font-family: BZar_0, DejaVu Sans, sans-serif; }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

From Dev

phpmyadmin is working fine but I can't find config.inc.php file?

From Dev

phpMyAdmin permissions for config.inc.php

From Dev

phpMyAdmin config.header.inc.php broken

From Dev

Can't locate Config.pm in @INC

From Dev

How can phpMyAdmin be restarted after /etc/phpmyadmin/config.inc.php is changed?

From Dev

Dose phpMyAdmin works without config.inc.php?

From Dev

Update phpmyadmin config.inc.php file in bash

From Dev

Modify the file 'config.inc.php' for XAMPP, PHPMyAdmin & MySQL setup

From Dev

Why Do I get Can't locate Module/Find.pm in @INC

From Dev

error in locking 'pma__column_info' after change in config.inc.php

From Dev

Access denied for phpMyAdmin after changing password,config.inc.php only readable

From Dev

Can't locate File/Remote.pm in @INC (@INC contains:

From Dev

Including css on each php page inc subfolder

From Dev

PHP inc/dec order of the sum of 2 numbers

From Dev

Can't locate Moo.pm in @INC

From Dev

Where can I get nagoa+.inc

From Dev

Perl, Can't locate Packet/UDP/Syslog.pm in @INC | custom modules

From Dev

Populate PHP sales table from MySQL (inc. empty months)

From Dev

How make dreamweaver color the code as php for .inc files

From Dev

How to change Directadmin.inc.php to support ssl login

From Dev

How To Get a PHP File To Do The Same Thing As An inc File?

From Dev

Can't locate XML/XPath.pm in @INC

From Dev

Can't locate Switch.pm in @INC in Ubuntu 16.04 LTS

From Dev

Perl - Path specified with -I doesn't show up on @INC

From Dev

Perl doesn't print @INC with -I option in one line program

From Dev

IOS Swift I can't get my real location from my app. I alway get the Apple Inc address

From Dev

I can't find php.ini file on Mac?

From Dev

I can't find php.ini file on Mac?

Related Related

  1. 1

    I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

  2. 2

    phpmyadmin is working fine but I can't find config.inc.php file?

  3. 3

    phpMyAdmin permissions for config.inc.php

  4. 4

    phpMyAdmin config.header.inc.php broken

  5. 5

    Can't locate Config.pm in @INC

  6. 6

    How can phpMyAdmin be restarted after /etc/phpmyadmin/config.inc.php is changed?

  7. 7

    Dose phpMyAdmin works without config.inc.php?

  8. 8

    Update phpmyadmin config.inc.php file in bash

  9. 9

    Modify the file 'config.inc.php' for XAMPP, PHPMyAdmin & MySQL setup

  10. 10

    Why Do I get Can't locate Module/Find.pm in @INC

  11. 11

    error in locking 'pma__column_info' after change in config.inc.php

  12. 12

    Access denied for phpMyAdmin after changing password,config.inc.php only readable

  13. 13

    Can't locate File/Remote.pm in @INC (@INC contains:

  14. 14

    Including css on each php page inc subfolder

  15. 15

    PHP inc/dec order of the sum of 2 numbers

  16. 16

    Can't locate Moo.pm in @INC

  17. 17

    Where can I get nagoa+.inc

  18. 18

    Perl, Can't locate Packet/UDP/Syslog.pm in @INC | custom modules

  19. 19

    Populate PHP sales table from MySQL (inc. empty months)

  20. 20

    How make dreamweaver color the code as php for .inc files

  21. 21

    How to change Directadmin.inc.php to support ssl login

  22. 22

    How To Get a PHP File To Do The Same Thing As An inc File?

  23. 23

    Can't locate XML/XPath.pm in @INC

  24. 24

    Can't locate Switch.pm in @INC in Ubuntu 16.04 LTS

  25. 25

    Perl - Path specified with -I doesn't show up on @INC

  26. 26

    Perl doesn't print @INC with -I option in one line program

  27. 27

    IOS Swift I can't get my real location from my app. I alway get the Apple Inc address

  28. 28

    I can't find php.ini file on Mac?

  29. 29

    I can't find php.ini file on Mac?

HotTag

Archive