cpdf_rect

(PHP 3>= 3.0.8, PHP 4 , PHP 5)

cpdf_rect -- Zeichnet ein Rechteck

Beschreibung

bool cpdf_rect ( int PDF-Dokument, float x-koor, float y-koor, float Breite, float Höhe [, int Modus])

Die Funktion cpdf_rect() zeichnet ein Rechteck, bei dem die linke untere Ecke im Punkt (x-koor, y-koor) liegt. Die Breite wird auf Breite und die Höhe auf Höhe gesetzt. Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.

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.

Beispiel 1. Drawing a rectangle

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

?>