| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.pdf.save">
- <title>Save Changes to PDF Documents</title>
- <para>
- There are two methods that save changes to PDF documents: the <classname>Zend_Pdf::save()</classname> and
- <classname>Zend_Pdf::render()</classname> methods.
- </para>
- <para>
- <classname>Zend_Pdf::save($filename, $updateOnly = false)</classname> saves the PDF document to a file. If $updateOnly
- is true, then only the new PDF file segment is appended to a file. Otherwise, the file is overwritten.
- </para>
- <para>
- <classname>Zend_Pdf::render($newSegmentOnly = false)</classname> returns the PDF document as a string. If
- $newSegmentOnly is true, then only the new PDF file segment is returned.
- </para>
- <example id="zend.pdf.save.example-1">
- <title>Saving PDF Documents</title>
- <programlisting language="php"><![CDATA[
- ...
- // Load the PDF document
- $pdf = Zend_Pdf::load($fileName);
- ...
- // Update the PDF document
- $pdf->save($fileName, true);
- // Save document as a new file
- $pdf->save($newFileName);
- // Return the PDF document as a string
- $pdfString = $pdf->render();
- ...
- ]]></programlisting>
- </example>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|