info about link
: Javascript : PHP Index : MySQL :
excudo pdf textblock
: Source : : Explanation : : Example : : Todo : : Feedback :

This example should look more or less familiar if you are used to work with Zend PDF

<?php
require_once 'Excudo_Pdf.php';
require_once 
'Excudo_Pdf_Page.php';
require_once 
'Excudo_Pdf_Textblock.php';

$pdf = new Excudo_Pdf();

// Add new page generated by Zend_Pdf object (page is attached to the specified document)
$pdf->pages[] = ($page1 $pdf->newPage('A4'));

// Create new font
$font Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);

// Apply font and draw text
$page1->setFont($font12);

$someVarHoldingLargeString "this is some text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text and this is some more text";

$eptb = new Excudo_Pdf_Textblock($font12);
// passing large string
$eptb->createBlock($someVarHoldingLargeString500);
// setting alignment
$eptb->setAlignment(Excudo_Pdf_Textblock::ALIGN_JUSTIFY);
// outputing, and saving height
$height $eptb->drawText($page110500);
// saving the pdf file
$pdf->save('test.pdf');
?>

=[Disclaimer]=     © 2005-2010 Excudo.net