Forum und email

cpdf_rect

(PHP 4, PHP 5 <= 5.0.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 ] )

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

Example#1 Zeichnen eines Rechtecks

<?php

$cpdf 
cpdf_open(0);
cpdf_page_init($cpdf105958421.0);

// die Füllfarbe auf Rot setzen
cpdf_setrgbcolor($cpdf100);

// ein (180 * 100) Rechteck zeichnen
cpdf_rect($cpdf645400180100);

// das Rechteck füllen
cpdf_fill($cpdf);

cpdf_finalize($cpdf);
Header("Content-type: application/pdf");
cpdf_output_buffer($cpdf);
cpdf_close($cpdf);

?>