Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-20-2007, 07:38 PM
Junior Member
 
Join Date: Oct 2007
Posts: 1
Default Zend_Pdf import image to PDF

Hi,
I created an image in PHP with GD2 library (png) and i need import it into created pdf in Zend_Pdf.
But it do nothing.

Thx for any help.

<?
$pdf = new Zend_Pdf();

$page = $pdf->newPage('510:745:');
$pdf->pages[] = $page;

// insert picture
$pic = new image();

$image = Zend_Pdf_Image::imageWithPath(imagepng($pic->PageVizitka()));

$page->drawImage($image, 200, 200, 0, 0);
$image = Zend_Pdf_Image::imageWithPath($image);

$page->drawImage($image, 200, 200, 0, 0);

// Set font
$page->setLineDashingPattern(Zend_Pdf_Page::LINE_DASHING _SOLID);
$page->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 0));
$page->drawCircle(85, 375, 25);


$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font ::FONT_HELVETICA), 20);

// Draw text
$page->drawText('Hello world!', 100, 510);

$pdfData = $pdf->render();

header("Content-Disposition: inline; filename=result.pdf");
header("Content-type: application/x-pdf");
echo $pdfData;
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:01 PM.