derek           Fri Sep  9 01:15:14 2005 EDT

  Modified files:              
    /phpdoc/en/reference/pdf/functions  pdf-add-note.xml 
  Log:
  Added an example
  
http://cvs.php.net/diff.php/phpdoc/en/reference/pdf/functions/pdf-add-note.xml?r1=1.4&r2=1.5&ty=u
Index: phpdoc/en/reference/pdf/functions/pdf-add-note.xml
diff -u phpdoc/en/reference/pdf/functions/pdf-add-note.xml:1.4 
phpdoc/en/reference/pdf/functions/pdf-add-note.xml:1.5
--- phpdoc/en/reference/pdf/functions/pdf-add-note.xml:1.4      Sat Aug  9 
00:31:33 2003
+++ phpdoc/en/reference/pdf/functions/pdf-add-note.xml  Fri Sep  9 01:15:13 2005
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <!-- splitted from ./en/functions/pdf.xml, last change in rev 1.42 -->
   <refentry id="function.pdf-add-note">
    <refnamediv>
@@ -26,6 +26,36 @@
      <literal>paragraph</literal>, <literal>newparagraph</literal>, 
      <literal>key</literal>, or <literal>help</literal>. &return.success;
     </para>
+    <para>
+     <example>
+      <title>Adding a note to a PDF document with PDFlib</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$pdfdoc = pdf_new();
+if (!pdf_open_file($pdfdoc, '')) {
+  echo 'error!';
+  exit;
+}
+pdf_begin_page($pdfdoc, 300, 300);
+if ($font = pdf_findfont($pdfdoc, 'Times-Roman', 'host', 0)) {
+  pdf_setfont($pdfdoc, $font, 10);
+}
+pdf_set_value($pdfdoc, 'textrendering', 0);
+pdf_add_note($pdfdoc, 100, 100, 180, 40, 'Note Content', 'Title', 'help', 0);
+pdf_show_xy($pdfdoc, 'Example', 100, 100);
+pdf_end_page($pdfdoc);
+pdf_close($pdfdoc);
+$data = pdf_get_buffer($pdfdoc);
+header('Content-type: application/pdf');
+header('Content-disposition: inline; filename=example.pdf');
+header('Content-length: '.strlen($data));
+echo $data;
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
    </refsect1>
   </refentry>
 

Reply via email to