生成和加载 PDF 文档
要生成新文档,需要创建
Example #1 生成新的或加载 PDF 文档
...
// Create new PDF document.
$pdf1 = new Zend_Pdf();
// Load PDF document from a file.
$pdf2 = Zend_Pdf::load($fileName);
// Load PDF document from a string.
$pdf3 = Zend_Pdf::parse($pdfString);
...
PDF 文件格式支持增量式文档更新。这样每次文档更新,就产生新的版本。Zend_Pdf 模块支持指定版本的读取。
版本可以指定为 Example #2 请求 PDF 文档的指定版本
...
// Load PDF previouse revision of the document.
$pdf1 = Zend_Pdf::load($fileName, 1);
// Load PDF previouse revision of the document.
$pdf2 = Zend_Pdf::parse($pdfString, 1);
// Load first revision of the document.
$pdf3 = Zend_Pdf::load($fileName);
$revisions = $pdf3->revisions();
$pdf3->rollback($revisions - 1);
...
[1] 方法必需在任何修改前调用,否则它的行为就没有定义。
|