CVS update: php3/doc/functions
| From: | steinm | Date: | Wed, 14 Apr 1999 10:08:48 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5048@lists.php.net to get a copy of this message | ||
Date: Wednesday April 14, 1999 @ 6:08
Author: steinm
Update of /repository/php3/doc/functions
In directory asf:/u/temp/cvs-serv14918
Modified Files:
pdf.sgml
Log Message:
Very simple example on how to use the pdf functions
Index: php3/doc/functions/pdf.sgml
diff -c php3/doc/functions/pdf.sgml:1.19 php3/doc/functions/pdf.sgml:1.20
*** php3/doc/functions/pdf.sgml:1.19 Thu Mar 25 01:27:46 1999
--- php3/doc/functions/pdf.sgml Wed Apr 14 06:08:47 1999
***************
*** 33,40 ****
the afm file for each font. By default these afm files are searched
for in a directory named 'fonts' relative to the directory where the
php3 script is located.
- </partintro>
<refentry id="function.pdf-get-info">
<refnamediv>
--- 33,81 ----
the afm file for each font. By default these afm files are searched
for in a directory named 'fonts' relative to the directory where the
php3 script is located.
+ <simpara>
+ Most of the functions are fairly easy to use. The most difficult part
+ is probably to create a very simple pdf document at all. The following
+ example should help to get started. It creates the file test.pdf
+ with one page. The page contains the text "Times-Roman" in an
+ outlined 30pt font. The text is underlined.
+ <example>
+ <title>PDF_get_info</title>
+ <programlisting>
+ <?php
+ $fp = fopen("test.pdf", "w");
+ $info = PDF_get_info();
+ pdf_set_info_author($info, "Uwe Steinmann");
+ PDF_set_info_title($info, "Test for PHP3 wrapper of PDFlib 0.6");
+ PDF_set_info_creator($info, "Name of Author");
+ pdf_set_info_creator($info, "See Author");
+ pdf_set_info_subject($info, "Testing");
+ $pdf = PDF_open($fp, $info);
+ PDF_begin_page($pdf, 595, 842);
+ PDF_add_outline($pdf, "Page 1");
+ pdf_set_font($pdf, "Times-Roman", 30, 4);
+ pdf_set_text_rendering($pdf, 1);
+ PDF_show_xy($pdf, "Times Roman outlined", 50, 750);
+ pdf_moveto($pdf, 50, 740);
+ pdf_lineto($pdf, 330, 740);
+ pdf_stroke($pdf);
+ PDF_end_page($pdf);
+ PDF_close($pdf);
+ echo "<A HREF=gettest.php3>finished</A>";
+ ?>
+ </programlisting>
+ The php3 file gettext.php3 just outputs the pdf document.
+ <programlisting>
+ <?php
+ $fp = fopen("test.pdf", "r");
+ header("Content-type: application/pdf");
+ fpassthru($fp);
+ fclose($fp);
+ ?>
+ </programlisting>
+ </example>
+ </partintro>
<refentry id="function.pdf-get-info">
<refnamediv>
***************
*** 52,68 ****
default info structure for the pdf document. It can be filled
with appropriate information like the author, subject etc.
- <example>
- <title>PDF_get_info</title>
- <programlisting>
- <?php $info = PDF_get_info();
- PDF_set_info_creator($info, "Name of Author") ?>
- </programlisting></example>
-
<para>
See also <function>PDF_set_info_creator</function>,
<function>PDF_set_info_subject</function>.
-
</refsect1>
</refentry>
--- 93,101 ----
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net