(PHP 4, PHP 5 <= 5.0.5)
cpdf_rect — Zeichnet ein Rechteck
Zeichnet ein Rechteck.
The document handle, returned by cpdf_open().
Die x-Koordinate der Ecke unten links
Die y-Koordinate der Ecke unten links
Die Breite des Rechtecks
Die Höhe des Rechtecks
The optional parameter mode determines the unit length. If it is 0 or omitted the default unit as specified for the page is used. Otherwise the coordinates are measured in postscript points disregarding the current unit.
Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.
Example#1 Zeichnen eines Rechtecks
<?php
$cpdf = cpdf_open(0);
cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
// die Füllfarbe auf Rot setzen
cpdf_setrgbcolor($cpdf, 1, 0, 0);
// ein (180 * 100) Rechteck zeichnen
cpdf_rect($cpdf, 645, 400, 180, 100);
// das Rechteck füllen
cpdf_fill($cpdf);
cpdf_finalize($cpdf);
Header("Content-type: application/pdf");
cpdf_output_buffer($cpdf);
cpdf_close($cpdf);
?>