cpdf_rect
(PHP 3>= 3.0.8, PHP 4 , PHP 5)
cpdf_rect -- Draw a rectangle
Description
bool
cpdf_rect ( int pdf_document, float x_coor, float y_coor, float width, float height [, int mode] )
The cpdf_rect() function draws a rectangle with
its lower left corner at point
(x_coor, y_coor).
This width is set to width.
This height is set to height. Retorna TRUE em caso de sucesso ou FALSE em falhas.
O parâmetro opcional mode
determina a unidade de tamanho. Se é 0 ou omitida, o valor padrão de unidade
especificado para a página é utilizada. Caso contrário, as coordenadas são medidas em postscript points
independentemente da unidade atual
Exemplo 1. Drawing a rectangle
<?php
$cpdf = cpdf_open(0); cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
// set the fill color to red cpdf_setrgbcolor($cpdf, 1, 0, 0);
// draw a (180 * 100) rectangle cpdf_rect($cpdf, 645, 400, 180, 100);
// fill the rectangle cpdf_fill($cpdf);
cpdf_finalize($cpdf); Header("Content-type: application/pdf"); cpdf_output_buffer($cpdf); cpdf_close($cpdf);
?>
|
|