diff options
-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); ?> |