Zend_Pdf-Save.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.pdf.save">
  4. <title>Save Changes to PDF Documents</title>
  5. <para>
  6. There are two methods that save changes to PDF documents: the <classname>Zend_Pdf::save()</classname> and
  7. <classname>Zend_Pdf::render()</classname> methods.
  8. </para>
  9. <para>
  10. <classname>Zend_Pdf::save($filename, $updateOnly = false)</classname> saves the PDF document to a file. If $updateOnly
  11. is true, then only the new PDF file segment is appended to a file. Otherwise, the file is overwritten.
  12. </para>
  13. <para>
  14. <classname>Zend_Pdf::render($newSegmentOnly = false)</classname> returns the PDF document as a string. If
  15. $newSegmentOnly is true, then only the new PDF file segment is returned.
  16. </para>
  17. <example id="zend.pdf.save.example-1">
  18. <title>Saving PDF Documents</title>
  19. <programlisting language="php"><![CDATA[
  20. ...
  21. // Load the PDF document
  22. $pdf = Zend_Pdf::load($fileName);
  23. ...
  24. // Update the PDF document
  25. $pdf->save($fileName, true);
  26. // Save document as a new file
  27. $pdf->save($newFileName);
  28. // Return the PDF document as a string
  29. $pdfString = $pdf->render();
  30. ...
  31. ]]></programlisting>
  32. </example>
  33. </sect1>
  34. <!--
  35. vim:se ts=4 sw=4 et:
  36. -->