Zend_Pdf-Save.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  4. <sect1 id="zend.pdf.save">
  5. <title>PDF ドキュメントへの変更内容の保存</title>
  6. <para>
  7. <acronym>PDF</acronym> ドキュメントの変更内容を保存するには 2 種類の方法があります。
  8. <methodname>Zend_Pdf::save()</methodname> および <methodname>Zend_Pdf::render()</methodname> メソッドです。
  9. </para>
  10. <para>
  11. <methodname>Zend_Pdf::save($filename, $updateOnly = false)</methodname> は、
  12. ドキュメントをファイルに保存します。$updateOnly が <constant>TRUE</constant> の場合は、
  13. 新しい <acronym>PDF</acronym> ファイルセグメントがファイルに追記されます。
  14. それ以外の場合はファイルが上書きされます。
  15. </para>
  16. <para>
  17. <methodname>Zend_Pdf::render($newSegmentOnly = false)</methodname> は、
  18. <acronym>PDF</acronym> ドキュメントを文字列として返します。$newSegmentOnly が <constant>TRUE</constant> の場合は、
  19. 新しい <acronym>PDF</acronym> ファイルセグメントのみが返されます。
  20. </para>
  21. <example id="zend.pdf.save.example-1">
  22. <title>PDF ドキュメントの保存</title>
  23. <programlisting language="php"><![CDATA[
  24. ...
  25. // PDF ドキュメントを読み込みます。
  26. $pdf = Zend_Pdf::load($fileName);
  27. ...
  28. // ドキュメントを更新します。
  29. $pdf->save($fileName, true);
  30. // ドキュメントを新しいファイルに保存します。
  31. $pdf->save($newFileName);
  32. // PDF ドキュメントを文字列で返します。
  33. $pdfString = $pdf->render();
  34. ...
  35. ]]></programlisting>
  36. </example>
  37. </sect1>
  38. <!--
  39. vim:se ts=4 sw=4 et:
  40. -->