CVS update: php3/tests
| From: | steinm | Date: | Thu, 27 May 1999 15:00:51 +0000 |
| Subject: | CVS update: php3/tests | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6080@lists.php.net to get a copy of this message | ||
Date: Thursday May 27, 1999 @ 11:00
Author: steinm
Update of /repository/php3/tests
In directory php:/tmp/cvs-serv5674/tests
Modified Files:
cpdf.php3
Log Message:
- more function in cpdf module (adding hyperlinks, annotation, outline)
- advanced test script for cpdf
- change to pgsql.c and php3_dav.h just beatifying
Index: php3/tests/cpdf.php3
diff -u php3/tests/cpdf.php3:1.1 php3/tests/cpdf.php3:1.2
--- php3/tests/cpdf.php3:1.1 Tue May 25 14:47:04 1999
+++ php3/tests/cpdf.php3 Thu May 27 11:00:51 1999
@@ -1,10 +1,48 @@
<?php
+ function draw_text($cpdf, $fontname, $size, $x, $y, $text="") {
+ cpdf_begin_text($cpdf);
+ cpdf_set_font($cpdf, $fontname, $size, 4);
+ if($text == "")
+ cpdf_text($cpdf, $fontname." ".$size." Point", $x, $y, 1);
+ else
+ cpdf_text($cpdf, $text, $x, $y, 1);
+ cpdf_end_text($cpdf);
+ }
+
$cpdf = cpdf_open(0);
- cpdf_page_init($cpdf, 1, 0, 400, 600);
- cpdf_begin_text($cpdf);
- cpdf_set_font($cpdf, "Helvetica", 18.0, 4);
- cpdf_text($cpdf, "Just a test", 100, 100);
- cpdf_end_text($cpdf);
+ cpdf_set_Creator($cpdf, "Creator");
+ cpdf_set_Title($cpdf, "Title");
+ cpdf_set_Subject($cpdf, "Subject");
+ cpdf_set_Keywords($cpdf, "Keyword1, Keyword2");
+
+ cpdf_page_init($cpdf, 1, 0, 400, 600, 1);
+ $level1 = cpdf_add_outline($cpdf, 0, 0, 1, 1, "Examples");
+ $level2a = cpdf_add_outline($cpdf, $level1, 1, 0, 1, "Text");
+ draw_text($cpdf, "Helvetica", 18.0, 50, 330);
+ draw_text($cpdf, "Helvetica-Bold", 18.0, 50, 310);
+ draw_text($cpdf, "Helvetica-Oblique", 18.0, 50, 290);
+ draw_text($cpdf, "Helvetica-BoldOblique", 18.0, 50, 270);
+ draw_text($cpdf, "Times-Roman", 18.0, 50, 250);
+ draw_text($cpdf, "Times-Bold", 18.0, 50, 230);
+ draw_text($cpdf, "Times-Italic", 18.0, 50, 210);
+ draw_text($cpdf, "Times-BoldItalic", 18.0, 50, 190);
+ draw_text($cpdf, "Courier", 18.0, 50, 170);
+ draw_text($cpdf, "Courier-Bold", 18.0, 50, 150);
+ draw_text($cpdf, "Courier-Oblique", 18.0, 50, 130);
+ draw_text($cpdf, "Courier-BoldOblique", 18.0, 50, 110);
+ draw_text($cpdf, "Symbol", 18.0, 50, 90);
+ draw_text($cpdf, "ZapfDingbats", 18.0, 50, 70);
+
+ cpdf_page_init($cpdf, 2, 0, 400, 600, 1);
+ $level2b = cpdf_add_outline($cpdf, $level2a, 0, 0, 2, "Annotations, Hyperlinks");
+ cpdf_set_annotation($cpdf, 100, 100, 300, 200, "Annotation", "Text of
Annotation");
+ draw_text($cpdf, "Helvetica", 12.0, 102, 116, "Click here to go to");
+ draw_text($cpdf, "Helvetica", 12.0, 102, 103, "http://localhost");
+ cpdf_set_action_url($cpdf, 100, 100, 202, 130, "http://localhost");
+
+ cpdf_page_init($cpdf, 3, 0, 400, 600, 1);
+ $level2c = cpdf_add_outline($cpdf, $level2b, 0, 0, 3, "Drawing");
+
cpdf_finalize($cpdf);
$arr = cpdf_get_buffer($cpdf);
cpdf_close($cpdf);
--
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