PHP Doku:: Setzt einfaches Strichmuster - function.pdf-setdash.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzNon-Text MIME-AusgabenPDFPDF FunktionenPDF_setdash

Ein Service von Reinhard Neidl - Webprogrammierung.

PDF Funktionen

<<PDF_setcolor

PDF_setdashpattern>>

PDF_setdash

(PHP 4, PECL pdflib >= 1.0.0)

PDF_setdashSetzt einfaches Strichmuster

Beschreibung

bool PDF_setdash ( resource $pdfdoc , float $b , float $w )

Setzt ein einfaches aktuelles Strichmuster. Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
Rkane
12.09.2006 20:18
Here is how I added a dashed line to my pdf.  I couldn't find any info on this, so I decided to write what I learned from trial and error.

On a page that is 612px wide and signified by $p, I drew a dashed line from left to right.
$p = pdf_new();
pdf_begin_document($p,"","");
pdf_begin_page_ext($p,612,792,"");

pdf_setdash($p,3,7);      //3,7 can be any set of numbers
pdf_save($p);                //This saves what already there
pdf_moveto($p,0,700);   //move the pointer here
pdf_lineto($p,612,700);      //draw a line
pdf_closepath_stroke($p);  //show the line
pdf_restore($p);               //put it all back

pdf_end_page_ext($p,"");
pdf_end_document($p,"");

$buf = pdf_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=hello.pdf");
print $buf;



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)