cpdf_rect

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

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] )

Zeichnet ein Rechteck.

Parameter Liste

pdf_document

The document handle, returned by cpdf_open().

x_koor

Die x-Koordinate der Ecke unten links

y_koor

Die y-Koordinate der Ecke unten links

Breite

Die Breite des Rechtecks

Höhe

Die Höhe des Rechtecks

mode

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.

Rückgabewerte

Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.

Beispiele

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

?>