source: branches/2.2/filemanager/tp/dompdf/INSTALL @ 3019

Revision 3019, 4.4 KB checked in by amuller, 14 years ago (diff)

Ticket #1135 - Corrigindo CSS e adicionando filemanager

Line 
1DOMPDF - PHP5 HTML to PDF converter
2===================================
3
4http://www.digitaljunkies.ca/dompdf
5Copyright (c) 2004 Benj Carson
6
7Send bug reports, patches, feature requests, complaints & hate mail (no spam
8thanks though) to <benjcarson@digitaljunkies.ca>
9
10##### See README for usage information. #####
11
12
13Installation
14------------
15
161. Untar/unzip the source package in a directory accessible by your
17   webserver.
18
192. Edit dompdf_config.inc.php to fit your installation.
20
213. Give your webserver write permission on the path specified in
22   DOMPDF_FONT_DIR (lib/fonts by default).  Under *nix, ideally you can make
23   the webserver group the owner of this directory and give the directory
24   group write permissions.  For example, on Debian systems, apache runs as
25   the www-data user:
26
27   $ chgrp www-data lib/fonts
28   $ chmod g+w lib/fonts
29
30   If your user is not a member of the www-data group or you do not have
31   root priviledges, you can make the directory world writable and set the
32   sticky bit:
33   
34   $ chmod 1777 lib/fonts
35
36
37Font Installation
38-----------------
39
40Linux/Unix:
41
42The load_font.php utility installs and converts TrueType fonts for use with
43DOMPDF.  Since CSS uses the concept of font families (i.e. the same face can
44be rendered in differnt styles & weights) DOMPDF needs to know which actual
45font files belong to which font family and which style.  For example, the
46Microsoft core font pack includes the files Verdana.ttf, Verdana_Italic.ttf,
47Verdana_Bold.ttf and Verdana_Bold_Italic.ttf.  All four of these files need
48to be present in the DOMPDF font directory (DOMPDF_FONT_DIR), and entries
49need to be made in the dompdf_font_family_cache file.
50
51Given the font family name and the path to the 'normal' font face file
52(Verdana.ttf, in our example), load_font.php will search for the bold,
53italic and bold italic font face files in the same directory as the
54specified file.  It searches for files with the same base name followed by
55'_Bold', 'B', or 'b' (similarly for italic and bold italic).  If it can not
56find the correct files, you can specify them on the command line.
57
58In addition to copying the files to the DOMPDF font directory, it also
59generates .afm files.  The R&OS PDF class requires both the ttf file and an
60afm file, which describes glyph metrics.  The afm file is generated using
61the ttf2pt1 utlity (available at http://ttf2pt1.sourceforge.net).
62
63
64usage:
65
66./load_font.php font-family n_file [b_file] [i_file] [bi_file]
67
68font_family:      the name of the font, e.g. Verdana, 'Times New Roman',
69                  monospace, sans-serif.
70
71n_file:           the .pfb or .ttf file for the normal, non-bold, non-italic
72                  face of the font.
73
74{b|i|bi}_file:    the files for each of the respective (bold, italic,
75                  bold-italic) faces.
76
77Examples:
78
79$ ./load_font.php silkscreen /usr/share/fonts/truetype/slkscr.ttf
80
81$ ./load_font.php 'Times New Roman' /mnt/c_drive/WINDOWS/Fonts/times.ttf
82
83$ php -f load_font.php -- sans-serif /home/dude_mcbacon/myfonts/Verdana.ttf \
84                                     /home/dude_mcbacon/myfonts/V_Bold.ttf
85
86Windows:
87
88(Note I don't have a windows test box at the moment, so these instructions
89may not work...  If someone has tried this and has any suggestions for me,
90please send me an email!)
91
92Read the Linux/Unix section above first, as most of it applies.  The main
93difference is the ttf2pt1 utility.  Fortunately, there is a windows version,
94available at http://gnuwin32.sourceforge.net/packages/ttf2pt1.htm.  You will
95have to edit your dompdf_config.inc.php file to point to the path where you
96installed ttf2pt1.
97
98You will also need the cli version of PHP in order to execute
99load_font.php, however it's usage is the same (see the last example above).
100
101
102Note for all platforms:
103
104PDFs include support by default for Helvetica, Times-Roman, Courier and
105ZapfDingbats.  You do not need to install any font files if you wish to use
106these fonts.  This has the advantage of reducing the size of the resulting
107PDF, because additional fonts must be embedded in the PDF.
108
109Also, if you have problems installing the font files, you can try and use
110the distributed dompdf_font_family_cache.dist file in lib/fonts.  Copy this
111file to lib/fonts/dompdf_font_family_cache and edit it directly to match the
112files present in your lib/fonts directory. You can uncomment the appropriate
113entries in dompdf_font_family_cache once you have copied the appropriate ttf
114files into lib/fonts and generated afm files for each one.
115
Note: See TracBrowser for help on using the repository browser.