diff options
author | Uwe Steinmann <steinm@php.net> | 1999-11-23 09:04:31 +0000 |
---|---|---|
committer | Uwe Steinmann <steinm@php.net> | 1999-11-23 09:04:31 +0000 |
commit | 39a389d855ba49c23993284698b2939dd20ad270 (patch) | |
tree | e9d65b2acd9dd40d3913b60bd8e1f37661e971aa /tests | |
parent | 42f8f2516de4331fe95738cbefa31f8c9fc59239 (diff) | |
download | php-git-39a389d855ba49c23993284698b2939dd20ad270.tar.gz |
- extended test script for cpdf by GD image insertion
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testcpdf | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/testcpdf b/tests/testcpdf index 9c2fe374e4..a74087d18e 100644 --- a/tests/testcpdf +++ b/tests/testcpdf @@ -78,11 +78,20 @@ cpdf_newpath($cpdf); /* needed because clip doesn't consume path */ draw_text($cpdf, "Helvetica", 18.0, 250, 130); cpdf_import_jpeg($cpdf, "figure.jpg", 300, 50, 0.0, 0.0, 300.0, 0.0, 0.0, 0, 1); /* watch for the second last parameter. It is 0 to disable extra gsave/grestore */ - cpdf_restore($cpdf); + cpdf_page_init($cpdf, 5, 0, 400, 400, 1); + $level2e = cpdf_add_outline($cpdf, $level2d, 0, 0, 5, "GD Image"); + + $gdimage = imagecreate(100, 100); + $color = imagecolorallocate($gdimage, 100, 190, 0); + $black = imagecolorallocate($gdimage, 0, 0, 0); + imageline($gdimage, 2, 2, 90, 90, $black); + + cpdf_place_inline_image($cpdf, $gdimage, 50, 50, 10.0, 150, 50.0, 1, 1); + imagedestroy($gdimage); + cpdf_finalize($cpdf); - Header("Content-type: application/pdf"); cpdf_output_buffer($cpdf); cpdf_close($cpdf); ?> |