/**
* @package Zend_Pdf
* @subpackage demo
*/"USAGE: php demo.php <pdf_file> [<output_pdf_file>]\n"'Can not open \'' . $argv[1] .
'\' file for reading.') {
// Create new PDF if file doesn't exist
// force complete file rewriting (instead of updating)
// Throw an exception if it's not the "Can't open file
// exception
throw $e;
}
}
//------------------------------------------------------------------------
// Reverse page order
// Create new Style
// Create new image object
'/stamp.jpg'// Example of operating with image loading exceptions.
'Image extension is not installed.' &&
$e->getMessage() != 'JPG support is not configured properly.'// Mark page as modified
'Modified by Zend Framework!', 150, 0)
->restoreGS();
}
// Add new page generated by Zend_Pdf object
// (page is attached to the specified the document)
'A4'));
// Add new page generated by Zend_Pdf_Page object
// (page is not attached to the document)
// Create new font
// Apply font and draw text
'#9999cc'))
->drawText('Helvetica 36 text string', 60, 500);
// Use font object for another page
$page2->setFont($font, 24)
->drawText('Helvetica 24 text string', 60, 500);
// Use another font
'Times-Roman 32 text string', 60, 450);
// Draw rectangle
// Draw circle
// Draw sectors
// Draw ellipse
// Draw and fill polygon
// ----------- Draw figures in modified coordination system --------------
// Coordination system movement
$page2->saveGS();
$page2->translate(60, 250); // Shift coordination system
// Draw rectangle
// Draw circle
// Draw sectors
// Draw ellipse
// Draw and fill polygon
// Draw line
// Coordination system movement, skewing and scaling
$page2->saveGS();
$page2->translate(60, 150) // Shift coordination system
// Skew coordination system
->scale(0.9, 0.9); // Scale coordination system
// Draw rectangle
// Draw circle
// Draw sectors
// Draw ellipse
// Draw and fill polygon
// Draw line
//------------------------------------------------------------------------
/* update */);
}