cvs: peardoc /en/package/images image-barcode.xml
| From: | Christian Weiske | Date: | Wed, 13 Dec 2006 20:48:09 +0000 |
| Subject: | cvs: peardoc /en/package/images image-barcode.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9067@lists.php.net to get a copy of this message | ||
cweiske Wed Dec 13 20:48:09 2006 UTC
Added files:
/peardoc/en/package/images image-barcode.xml
Log:
Image_Barcode documentation
http://cvs.php.net/viewvc.cgi/peardoc/en/package/images/image-barcode.xml?view=markup&rev=1.1
Index: peardoc/en/package/images/image-barcode.xml
+++ peardoc/en/package/images/image-barcode.xml
<!-- $Revision: 1.1 $ -->
<sect1 id="package.images.image-barcode">
<title>Image_Barcode</title>
<para>
<classname>Image_Barcode</classname> lets you create barcode representations
of strings. The package supports multiple drivers, letting you create
barcodes of the following type:
</para>
<itemizedlist>
<listitem>
<para>
Code 39
</para>
</listitem>
<listitem>
<para>
Code 128
</para>
</listitem>
<listitem>
<para>
EAN 13
</para>
</listitem>
<listitem>
<para>
INT 25
</para>
</listitem>
<listitem>
<para>
PostNet
</para>
</listitem>
<listitem>
<para>
UPCA
</para>
</listitem>
</itemizedlist>
<sect2>
<title>Using Image_Barcode</title>
<para>
Creating a barcode is as simple as calling the classes
static <function>draw</function> method after including
<filename>Image/Barcode.php</filename>.
</para>
<para>
The method has four parameters: The first is the string that shall be
converted into barcode representation. The second parameter determines
which driver/type should be used; it is one of:
<literal>Code39</literal>, <literal>code128</literal>,
<literal>ean13</literal>, <literal>int25</literal>,
<literal>postnet</literal> or <literal>upca</literal>.
</para>
<note>
<para>
The case difference between <literal>Code39</literal> and
<literal>code128</literal> has no reason and makes no sense,
but is kept because of backward compatibility.
</para>
</note>
<para>
The third parameter of <function>draw</function> determines
the type of the image that is generated; one of
<literal>jpg</literal>, <literal>png</literal> and
<literal>gif</literal>.
</para>
<para>
By default, the image generated by the barcode driver is directly
output to the browser. If you do not want this, pass
<literal>false</literal> as fourth parameter and
<function>draw</function> will return the GD image resource
object; allowing you to do further things with it.
</para>
</sect2>
<sect2>
<title>Simple example</title>
<programlisting role="php"><![CDATA[<?php
require_once 'Image/Barcode.php';
Image_Barcode::draw('1234', 'int25', 'png');
?>]]></programlisting>
<para>
As with all PEAR packages, installing the package also installs
some more examples in the <filename>docs/Image_Barcode</filename>
directory of your PEAR installation.
</para>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->