1. Trang chủ
  2. » Công Nghệ Thông Tin

PHP Developer''''s Dictionary- P67 doc

5 177 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 370,76 KB

Nội dung

PHP Developer’s Dictionary IT-SC book 330 pdf_set_transition() Syntax void pdf_set_transition (int pdf document , int transition ) Description The pdf_set_transition() function, which was added in PHP 3.0.6 and PHP 4.0, specifies the type and parameters for transition effects of the current page. The transition happens when going from another page to the current page. The transition parameter can have the following values: 1. 0—No transition 2. 1 —Two lines sweeping across the display to reveal the page 3. 2 —Multiple lines sweeping across the display to reveal the page 4. 3 —A box that reveals the page 5. 4 —A single line sweeping across the display that reveals the page 6. 5 —The previous page dissolves and shows the next page 7. 6 —The dissolve effect moves from one screen edge to another 8. 7 —The old page is replaced by the new page, which is the default pdf_set_duration() Syntax void pdf_set_duration (int pdf document, double duration) Description The pdf_set_duration() function, which was added in PHP 3.0.6 and PHP 4.0, sets the amount of time elapsed between page changes. This can be used in combination with the pdf_transition() function. pdf_open_gif Syntax PHP Developer’s Dictionary IT-SC book 331 int pdf_open_gif (int pdf document, string filename) Description The pdf_open_gif() function, which was added in PHP 3.0.6 and PHP 4.0, opens a GIF file specified by the filename parameter. The return value is a PDF image identifier that can be used for subsequent calls. pdf_open_memory_image() Syntax int pdf_open_memory_image (int pdf document, int image) Description The pdf_open_memory_image() function, which was added in PHP 3.0.10 and PHP 4.0b2, makes an image that was created using PHP's image functions available for the PDF document. The return value is a PDF image identifier. pdf_open_jpeg() Syntax int pdf_open_jpeg (int pdf docment, string filename) Description The pdf_open_jpeg() function, which was added in PHP 3.0.7 and PHP 4.0b2, imports a JPEG image from a file specified by the filename parameter and returns a PDF image identifier. pdf_close_image() Syntax void pdf_close_image (int image) PHP Developer’s Dictionary IT-SC book 332 Description The pdf_close_image() function, which was added in PHP 3.0.7 and PHP 4.0b2, closes any image opened with a PDF image open function. pdf_place_image() Syntax void pdf_place_image (int pdf document, int image, double x-coor, double y-coor, double scale) Description The pdf_place_image() function, which was added in PHP 3.0.7 and PHP 4.0b2, places an image on the page at the location specified by the x and y coordinates. The scale parameter enables you to adjust the image size. Scaling adjusts the size of pixels but doesn't do any down sampling. pdf_put_image() Syntax void pdf_put_image (int pdf document, int image) Description The pdf_put_image() function, which was added in PHP 3.0.7 and was removed after PHP 4.0b4, enables the image to be placed into a PDF file without showing it until the pdf_execute_function() is called. This function is not used for pdflib versions higher than 2.01. pdf_execute_image() Syntax void pdf_execute_image (int pdf document, int image, double x-coor, double y-coor, double scale) Description PHP Developer’s Dictionary IT-SC book 333 The pdf_execute_image() function, which was added in PHP 3.0.7 and was removed after PHP 4.0b4, causes an image placed in a PDF document with pdf_put_image() to display at the x and y coordinates. The image can be scaled at the time of display by using the scale parameter, where a value of 1 indicates original size. pdf_add_annotation() Syntax void pdf_add_annotation (int pdf document, double llx, double lly, double urx, double ury, string title, string content) Description The pdf_add_annotation() function, which was added in PHP 3.0.12 and PHP 4.0.b2, adds an annotation in the rectangle bounded by the llx , lly and urx , ury points. The parameters title and content set the title and content values of the annotation, respectively. XML Parser The XML parser functions available in PHP enable you to parse, but not validate, XML documents. The extension lets you create parsers that have corresponding handlers for each XML event. Note that case-folding, in XML parlance, simply means uppercasing, and all element names that are passed to the handlers are uppercased. To include XML support using Apache 1.3.7 or later, just pass with-xml as an argument to PHP's configure. Prior versions of Apache require that you include the expat library, which can be found at http://www.jclark.com/xml/ . xml_parser_create() Syntax int xml_parser_create ([string encoding ]) Description The xml_parser_create() function, which was added in PHP 3.0.6 and PHP 4, establishes an XML parser using the specified encoding method, which can be ISO- 8859-1 (default), US-ASCII , or UTF-8 , and returns a handle to the parser for subsequent XML function calls. xml_set_object() PHP Developer’s Dictionary IT-SC book 334 Syntax void xml_set_object (int parser, object &object) Description The xml_set_object() function, which was added in PHP 4.0b4, enables you to use the parser inside the object . This allows you to reference the parser created with xml_parser_create() inside your class. <?php class xmlobject { var $parser; function xmlobject() { $this->parser = xml_parser_create(); xml_set_object($this->parser,&$this); xml_set_element_handler($this->parser,"tag_open","tag_close"); xml_set_character_data_handler($this->parser,"cdata"); } //xmlobject methods… } // end of class xml ?> xml_set_element_handler() Syntax int xml_set_element_handler (int parser, string startElementHandler, string endElementHandler) Description The xml_set_element_handler() function, which was added in PHP 3.0.6 and PHP 4.0, identifies the startElementHandler and endElementHandler functions for the XML parser parser . If either handler string is FALSE or empty, the parser will be disabled. The return value is TRUE if the handlers were set up successfully and FALSE if the parser is invalid. The startElementHandler function must have three parameters: • parser —An integer value that is a reference to the XML parser that called the handler function. . Syntax PHP Developer’s Dictionary IT-SC book 331 int pdf_open_gif (int pdf document, string filename) Description The pdf_open_gif() function, which was added in PHP 3.0.6 and PHP 4.0,. pdf_open_memory_image (int pdf document, int image) Description The pdf_open_memory_image() function, which was added in PHP 3.0.10 and PHP 4.0b2, makes an image that was created using PHP& apos;s image. Syntax void pdf_set_duration (int pdf document, double duration) Description The pdf_set_duration() function, which was added in PHP 3.0.6 and PHP 4.0, sets the amount of time elapsed

Ngày đăng: 07/07/2014, 05:20