Last 5.3 release ever available: PHP 5.3.29 - 5.3 now EOL


(PHP 4, PECL pdflib >= 1.0.0)

PDF_setlinewidthConfigure la largeur de ligne


bool PDF_setlinewidth ( resource $p , float $width )

PDF_setlinewidth() configure la largeur de ligne à width. Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

add a note add a note

User Contributed Notes 1 note

bob at nijman dot de
13 years ago
This will draw a simple rectangle...
...with a few extras.


//Create & Open PDF-Object
$pdf = pdf_new();
pdf_set_info($pdf, "Author","Bob Nijman");
pdf_set_info($pdf, "Title","");
pdf_set_info($pdf, "Creator", "");
pdf_set_info($pdf, "Subject", "pdf-stuff");
pdf_begin_page($pdf, 200, 200);

// just a simple rectangle
pdf_setlinewidth($pdf, 5); //make the border of the rectangle a bit wider
pdf_rotate($pdf, 5); //rotate the coordinate system (NOT THE RECTANGLE !!!!!)
pdf_rect($pdf, 100, 100, 50, 50); //draw the rectangle
pdf_stroke($pdf); //stroke the path with the current color(not yet :-)) and line width

//note: the rect is not drawn untill we use pdf_stroke - try it out!!!

//close it up
$data = pdf_get_buffer($pdf);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=invoice.pdf');
header('Content-length: ' . strlen($data));


Thanx to:
Great german (!!!) tutorial
To Top