📄 fdf.examples.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Examples</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="fdf.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.fdf.html">FDF Functions</a></div> <div class="up"><a href="book.fdf.html">FDF</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Examples</h1> <p class="para"> The following examples shows just the evaluation of form data. <div class="example"> <p><b>Example #1 Evaluating a FDF document</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Open fdf from input string provided by the extension<br />// The pdf form contained several input text fields with the names<br />// volume, date, comment, publisher, preparer, and two checkboxes<br />// show_publisher and show_preparer.<br /></span><span style="color: #0000BB">$fdf </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_open_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$HTTP_FDF_DATA</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$volume </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"volume"</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The volume field has the value '<b>$volume</b>'<br />"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$date </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"date"</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The date field has the value '<b>$date</b>'<br />"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$comment </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"comment"</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The comment field has the value '<b>$comment</b>'<br />"</span><span style="color: #007700">;<br /><br />if (</span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"show_publisher"</span><span style="color: #007700">) == </span><span style="color: #DD0000">"On"</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$publisher </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"publisher"</span><span style="color: #007700">);<br /> echo </span><span style="color: #DD0000">"The publisher field has the value '<b>$publisher</b>'<br />"</span><span style="color: #007700">;<br />} else<br /> echo </span><span style="color: #DD0000">"Publisher shall not be shown.<br />"</span><span style="color: #007700">;<br /><br />if (</span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"show_preparer"</span><span style="color: #007700">) == </span><span style="color: #DD0000">"On"</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$preparer </span><span style="color: #007700">= </span><span style="color: #0000BB">fdf_get_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">, </span><span style="color: #DD0000">"preparer"</span><span style="color: #007700">);<br /> echo </span><span style="color: #DD0000">"The preparer field has the value '<b>$preparer</b>'<br />"</span><span style="color: #007700">;<br />} else<br /> echo </span><span style="color: #DD0000">"Preparer shall not be shown.<br />"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">fdf_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="fdf.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.fdf.html">FDF Functions</a></div> <div class="up"><a href="book.fdf.html">FDF</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -