PHP : Function Reference : PDF Functions : PDF_moveto
Examples ( Source code ) » PDF_moveto
<?php
//Create & Open PDF-Object
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "Author","Cristian Eugen");
pdf_set_info($pdf, "Title","www.navioo.com");
pdf_set_info($pdf, "Creator", "bob@navioo.com");
pdf_set_info($pdf, "Subject", "pdf-tests");
pdf_begin_page($pdf, 200, 200);
//
pdf_moveto($pdfdoc, 100, 100);
pdf_lineto($pdfdoc, 200, 200);
pdf_lineto($pdfdoc, 100, 200);
pdf_closepath_fill_stroke($pdfdoc);
pdf_circle($pdfdoc, 250, 250, 30);
pdf_stroke($pdfdoc);
pdf_rect($pdfdoc, 100, 210, 120, 120);
pdf_stroke($pdfdoc);
//close it up
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=mytest.pdf');
header('Content-length: ' . strlen($data));
echo $data;
?>
|