From 04e007443b95d48a34167b958c600844964162ab Mon Sep 17 00:00:00 2001 From: Daniel Beckham Date: Thu, 17 May 2001 22:40:32 +0000 Subject: [PATCH] clarified analog clock description and reference to CLibPDF, fixed return type of PDF_findfont, put PDF_open_memory_image in aphanumeric order and converted some of the function names from pdf_ to PDF_ git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@47729 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pdf.xml | 173 ++++++++++++++++++++++++++-------------------- 1 file changed, 97 insertions(+), 76 deletions(-) diff --git a/functions/pdf.xml b/functions/pdf.xml index b17464c5f4..877a22d474 100644 --- a/functions/pdf.xml +++ b/functions/pdf.xml @@ -293,12 +293,11 @@ readfile($filename); The PDFlib distribution contains a more complex example which - creates a page with an analog clock. Here we use - the in memory creation feature of PDFlib, so we don't need - any tmp-files. This example - converted into PHP using PDFlib looks as the following (you - can see the same example in the documentation for the - clibpdf module): + creates a page with an analog clock. Here we use the in memory + creation feature of PDFlib to alleviate the need to use temporary + files. The example, converted to PHP from the PDFlib example, is + as follows: (The same example is available in the CLibPDF documentation.) @@ -536,7 +535,7 @@ PDF_delete($pdf); - pdf_add_outline + PDF_add_outline Deprecated: Adds bookmark for current page @@ -1151,7 +1150,7 @@ PDF_delete($pdf); Description - void PDF_findfont + int PDF_findfont int pdf object string fontname string encoding^ @@ -1165,6 +1164,25 @@ PDF_delete($pdf); "macroman", "winansi", "host", or a user-defined encoding name, or the name of a CMap. + + PDF_findfont returns a font handle or false + on error. + + + + <function>PDF_findfont</function> example + +<php + +$font = pdf_findfont($pdf, "Times New Roman", "winansi", 1); +if ($font) { + pdf_setfont($pdf, $font, 10); +} + +?> + + + @@ -1470,7 +1488,7 @@ PDF_delete($pdf); - pdf_open + PDF_open Deprecated: Open a new pdf object @@ -1656,6 +1674,47 @@ echo $data; + + + PDF_open_memory_image + Opens an image created with PHP's image functions + + + Description + + + int PDF_open_memory_image + int pdf object + int image + + + + The PDF_open_memory_image function takes + an image created with the PHP's image functions and makes it available + for the pdf object. The function returns a pdf + image identifier. + + + Including a memory image + +<?php +$im = ImageCreate(100, 100); +$col = ImageColorAllocate($im, 80, 45, 190); +ImageFill($im, 10, 10, $col); +$pim = PDF_open_memory_image($pdf, $im); +ImageDestroy($im); +PDF_place_image($pdf, $pim, 100, 100, 1); +PDF_close_image($pdf, $pim); +?> + + + + See also PDF_close_image, + PDF_place_image. + + + + PDF_open_pdi @@ -1963,28 +2022,31 @@ echo $data; - - - PDF_setfont - Set the current font - - - Description - - - void PDF_setfont - int pdf object - int font - double size - - - - Set the current font in the given size, using a - font handle returned by - PDF_findfont - - - + + + PDF_setfont + Set the current font + + + Description + + + void PDF_setfont + int pdf object + int font + double size + + + + Set the current font in the given size, using a + font handle returned by + PDF_findfont + + + See Also: PDF_findfont. + + + @@ -2351,7 +2413,7 @@ echo $data; - pdf_set_duration + PDF_set_duration Deprecated: Sets duration between pages @@ -2505,7 +2567,7 @@ echo $data; - pdf_set_text_rise + PDF_set_text_rise Deprecated: Sets the text rise @@ -2521,7 +2583,7 @@ echo $data; - pdf_set_text_matrix + PDF_set_text_matrix Deprecated: Sets the text matrix @@ -2555,7 +2617,7 @@ echo $data; - pdf_set_word_spacing + PDF_set_word_spacing Depriciated: Sets spacing between words @@ -2725,47 +2787,6 @@ echo $data; - - - PDF_open_memory_image - Opens an image created with PHP's image functions - - - Description - - - int PDF_open_memory_image - int pdf object - int image - - - - The PDF_open_memory_image function takes - an image created with the PHP's image functions and makes it available - for the pdf object. The function returns a pdf - image identifier. - - - Including a memory image - -<?php -$im = ImageCreate(100, 100); -$col = ImageColorAllocate($im, 80, 45, 190); -ImageFill($im, 10, 10, $col); -$pim = PDF_open_memory_image($pdf, $im); -ImageDestroy($im); -PDF_place_image($pdf, $pim, 100, 100, 1); -PDF_close_image($pdf, $pim); -?> - - - - - See also PDF_close_image, - PDF_place_image. - - -