<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.8">
  <compounddef id="Printer_8php" kind="file">
    <compoundname>Printer.php</compoundname>
    <innerclass refid="classMike42_1_1Escpos_1_1Printer" prot="public">Mike42::Escpos::Printer</innerclass>
    <innernamespace refid="namespaceMike42_1_1Escpos">Mike42::Escpos</innernamespace>
    <innernamespace refid="namespaceMike42_1_1Escpos_1_1PrintBuffers_1_1PrintBuffer">Mike42::Escpos::PrintBuffers::PrintBuffer</innernamespace>
    <innernamespace refid="namespaceMike42_1_1Escpos_1_1PrintBuffers_1_1EscposPrintBuffer">Mike42::Escpos::PrintBuffers::EscposPrintBuffer</innernamespace>
    <innernamespace refid="namespaceMike42_1_1Escpos_1_1PrintConnectors_1_1PrintConnector">Mike42::Escpos::PrintConnectors::PrintConnector</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="normal">&lt;?php</highlight></codeline>
<codeline lineno="13"><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceMike42_1_1Escpos" kindref="compound">Mike42\Escpos</ref>;</highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal">use<sp/><ref refid="namespaceException" kindref="compound">Exception</ref>;</highlight></codeline>
<codeline lineno="16"><highlight class="normal">use<sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>;</highlight></codeline>
<codeline lineno="17"><highlight class="normal">use<sp/><ref refid="namespaceMike42_1_1Escpos_1_1PrintBuffers_1_1PrintBuffer" kindref="compound">Mike42\Escpos\PrintBuffers\PrintBuffer</ref>;</highlight></codeline>
<codeline lineno="18"><highlight class="normal">use<sp/><ref refid="namespaceMike42_1_1Escpos_1_1PrintBuffers_1_1EscposPrintBuffer" kindref="compound">Mike42\Escpos\PrintBuffers\EscposPrintBuffer</ref>;</highlight></codeline>
<codeline lineno="19"><highlight class="normal">use<sp/><ref refid="namespaceMike42_1_1Escpos_1_1PrintConnectors_1_1PrintConnector" kindref="compound">Mike42\Escpos\PrintConnectors\PrintConnector</ref>;</highlight></codeline>
<codeline lineno="20"><highlight class="normal">use<sp/><ref refid="namespaceMike42_1_1Escpos_1_1CapabilityProfile" kindref="compound">Mike42\Escpos\CapabilityProfile</ref>;</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="25" refid="classMike42_1_1Escpos_1_1Printer" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classMike42_1_1Escpos_1_1Printer" kindref="compound">Printer</ref></highlight></codeline>
<codeline lineno="26"><highlight class="normal">{</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a21ceecfcdb01690686b97ec3952cb41a" kindref="member">NUL</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x00&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1afd0eba2feab5ba9399f18af016702560" kindref="member">LF</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x0a&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a52511e5958f9c8680df1f02f6b48fd75" kindref="member">ESC</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x1b&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab3ef19d50a092595fb0cd48b8998ea07" kindref="member">FS</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x1c&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5857b09ed01b25da1d4186ee8e28585c" kindref="member">FF</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x0c&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a6862c6d42553030543b994fdcd29900e" kindref="member">GS</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x1d&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aad9c1d39a01ee229aec9e0377e44bb1c" kindref="member">DLE</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x10&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="61"><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a456ed47d529ee5c3ccdaac1f64e004be" kindref="member">EOT</ref><sp/>=<sp/></highlight><highlight class="stringliteral">&quot;\x04&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ae2115aa1dd0970aa7368f9e70132a248" kindref="member">BARCODE_UPCA</ref><sp/>=<sp/>65;</highlight></codeline>
<codeline lineno="71"><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1adb302aa72ac33d94e0f3cc71960c7b1d" kindref="member">BARCODE_UPCE</ref><sp/>=<sp/>66;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a06afaf2a24ec2e685e7faa5ac31694e9" kindref="member">BARCODE_JAN13</ref><sp/>=<sp/>67;</highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ade86277975ec538f3e4b94ec6993d85c" kindref="member">BARCODE_JAN8</ref><sp/>=<sp/>68;</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a35c830aafd30bba5db50d4c79d910987" kindref="member">BARCODE_CODE39</ref><sp/>=<sp/>69;</highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a2d28b31688aaac9e2f26f9731cc42100" kindref="member">BARCODE_ITF</ref><sp/>=<sp/>70;</highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a7264ce01bd9302d8886032631be0af84" kindref="member">BARCODE_CODABAR</ref><sp/>=<sp/>71;</highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ac8dd1124238c7659663e8f1206a23a1d" kindref="member">BARCODE_CODE93</ref><sp/>=<sp/>72;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a0dbbe67dca189d4489c46cfaff9a5aa6" kindref="member">BARCODE_CODE128</ref><sp/>=<sp/>73;</highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a75616e46e6eb86fc6b2ac952c1f8c836" kindref="member">BARCODE_TEXT_NONE</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a86115cf77a6d535bc8e57d1183e6ccdf" kindref="member">BARCODE_TEXT_ABOVE</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="123"><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a02942fb3993ade7efb090967538509a1" kindref="member">BARCODE_TEXT_BELOW</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="129"><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af7a526c77a779d7795ce2e9c6e371c64" kindref="member">COLOR_1</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a1468d9eef8a5c39e0c60001938a0f8c3" kindref="member">COLOR_2</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a801123bac2a901104cf7caf7a7c7be04" kindref="member">CUT_FULL</ref><sp/>=<sp/>65;</highlight></codeline>
<codeline lineno="144"><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1acdb438c32e19ce80174da2b7b6c2eb81" kindref="member">CUT_PARTIAL</ref><sp/>=<sp/>66;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"></highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a2872ec5593e654db593a1e7d208b4097" kindref="member">FONT_A</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a95be90aa7a768cce3b16f05cdc13b6d5" kindref="member">FONT_B</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ae05bf1794c04947792f3ab43b37e6289" kindref="member">FONT_C</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="164"><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aad4110ca44a49258437b73b8f69b153d" kindref="member">IMG_DEFAULT</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="170"><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a153742a99bd7b8807603a078b992b89f" kindref="member">IMG_DOUBLE_WIDTH</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5c3b06a2e653012fd4df0969afb490c6" kindref="member">IMG_DOUBLE_HEIGHT</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a207e6bd79fcabbf0103c6545e7bfd1a3" kindref="member">JUSTIFY_LEFT</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"></highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1abe3467661e7ee8af2a8fe376ffb21935" kindref="member">JUSTIFY_CENTER</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="192"><highlight class="normal"></highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a7fea6669f06350151e00162093b87cb2" kindref="member">JUSTIFY_RIGHT</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1abe0bc707395eab85b236e06d83002cff" kindref="member">MODE_FONT_A</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af0e9c20dc3ad99574315272d1c7fb099" kindref="member">MODE_FONT_B</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="207"><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a94adaca51f7ea233319dbc2c944785ad" kindref="member">MODE_EMPHASIZED</ref><sp/>=<sp/>8;</highlight></codeline>
<codeline lineno="212"><highlight class="normal"></highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a2a596820f03bd86f710eeb97afe1af3b" kindref="member">MODE_DOUBLE_HEIGHT</ref><sp/>=<sp/>16;</highlight></codeline>
<codeline lineno="217"><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af6dd4712feba919bf0e7e2c530c609cd" kindref="member">MODE_DOUBLE_WIDTH</ref><sp/>=<sp/>32;</highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aacc2be8b50c3a1c7b8e87575f4a6acc1" kindref="member">MODE_UNDERLINE</ref><sp/>=<sp/>128;</highlight></codeline>
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a786ac596e03e2086f8e534eda2ea9396" kindref="member">PDF417_STANDARD</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab2239ce9176bbb9faba338a4b5eafd0c" kindref="member">PDF417_TRUNCATED</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af9116ea373fd8a10e73f20f6eb3c05e8" kindref="member">QR_ECLEVEL_L</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="242"><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a292fc0c33c2e1a0b489876e4b3ed67a8" kindref="member">QR_ECLEVEL_M</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="247"><highlight class="normal"></highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a3d4b32a4b4597b9733ae162941b51cc6" kindref="member">QR_ECLEVEL_Q</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"></highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a6b08da7e97fc87b14976e86b6d5b072e" kindref="member">QR_ECLEVEL_H</ref><sp/>=<sp/>3;</highlight></codeline>
<codeline lineno="257"><highlight class="normal"></highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a1657402a83f05e78bac6acc027d11040" kindref="member">QR_MODEL_1</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="262"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ad068f187eabd7d438f5c1b67721e9b5c" kindref="member">QR_MODEL_2</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a31483502193af1ed540cf4773bd3e487" kindref="member">QR_MICRO</ref><sp/>=<sp/>3;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"></highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1afbf2ebb993566f079ac6b28c9885c4ab" kindref="member">STATUS_PRINTER</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="278"><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a47d9a0f8c24dc9da0da102ef308d6531" kindref="member">STATUS_OFFLINE_CAUSE</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a8bb47542434b22b32dba793087ee029e" kindref="member">STATUS_ERROR_CAUSE</ref><sp/>=<sp/>3;</highlight></codeline>
<codeline lineno="290"><highlight class="normal"></highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a79d273e6fcf51ca7d85728a0c015b89d" kindref="member">STATUS_PAPER_ROLL</ref><sp/>=<sp/>4;</highlight></codeline>
<codeline lineno="296"><highlight class="normal"></highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a8ef3c7527406e54f4169f18c7ed1791a" kindref="member">STATUS_INK_A</ref><sp/>=<sp/>7;</highlight></codeline>
<codeline lineno="302"><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a6310ea0d03a58b8f23dd36c57a66b5f4" kindref="member">STATUS_INK_B</ref><sp/>=<sp/>6;</highlight></codeline>
<codeline lineno="308"><highlight class="normal"></highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ac64de508f5636df3eb515725fbd1fc31" kindref="member">STATUS_PEELER</ref><sp/>=<sp/>8;</highlight></codeline>
<codeline lineno="314"><highlight class="normal"></highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5904b8b6661aeaa3f10ff4c3e4328403" kindref="member">UNDERLINE_NONE</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="319"><highlight class="normal"></highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aeeaea6359c8febd8884b89b45e339248" kindref="member">UNDERLINE_SINGLE</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="324"><highlight class="normal"></highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a9225dee3a17e881c168a1513701ef331" kindref="member">UNDERLINE_DOUBLE</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="329"><highlight class="normal"></highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aaca2df4c970a1e5c6af4699e5cb2f4b4" kindref="member">$buffer</ref>;</highlight></codeline>
<codeline lineno="335"><highlight class="normal"></highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab18a4111c2f953b14d8c3e4d97e14c1e" kindref="member">$connector</ref>;</highlight></codeline>
<codeline lineno="341"><highlight class="normal"></highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a79f173872a0f2d98f11efd9f876e1890" kindref="member">$profile</ref>;</highlight></codeline>
<codeline lineno="347"><highlight class="normal"></highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a31b6c6ac59cc572e87e96b67397b9c9a" kindref="member">$characterTable</ref>;</highlight></codeline>
<codeline lineno="353"><highlight class="normal"></highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1acc6fa5faae88c5e113416187fc85b330" kindref="member">__construct</ref>(<ref refid="interfaceMike42_1_1Escpos_1_1PrintConnectors_1_1PrintConnector" kindref="compound">PrintConnector</ref><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab18a4111c2f953b14d8c3e4d97e14c1e" kindref="member">$connector</ref>,<sp/><ref refid="classMike42_1_1Escpos_1_1CapabilityProfile" kindref="compound">CapabilityProfile</ref><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a79f173872a0f2d98f11efd9f876e1890" kindref="member">$profile</ref><sp/>=<sp/>null)</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>connector<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab18a4111c2f953b14d8c3e4d97e14c1e" kindref="member">$connector</ref>;</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>capability<sp/>profile<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classMike42_1_1Escpos_1_1Printer_1a79f173872a0f2d98f11efd9f876e1890" kindref="member">$profile</ref><sp/>===<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a79f173872a0f2d98f11efd9f876e1890" kindref="member">$profile</ref><sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1CapabilityProfile_1a6df70056fefa1d4ae683caca6584ef34" kindref="member">CapabilityProfile::load</ref>(</highlight><highlight class="stringliteral">&apos;default&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>profile<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a79f173872a0f2d98f11efd9f876e1890" kindref="member">$profile</ref>;</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>buffer<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aaca2df4c970a1e5c6af4699e5cb2f4b4" kindref="member">$buffer</ref><sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintBuffers_1_1EscposPrintBuffer" kindref="compound">EscposPrintBuffer</ref>();</highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>=<sp/>null;</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a20152d828bb33ea42de9718f7c0da1dc" kindref="member">setPrintBuffer</ref>(<ref refid="classMike42_1_1Escpos_1_1Printer_1aaca2df4c970a1e5c6af4699e5cb2f4b4" kindref="member">$buffer</ref>);</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a8ebf7acd6cb7a30f647eb7475361fab9" kindref="member">initialize</ref>();</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a10bdd1d0399261f8c3b95b46597d7dd8" kindref="member">barcode</ref>($content,<sp/>$type<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a35c830aafd30bba5db50d4c79d910987" kindref="member">Printer::BARCODE_CODE39</ref>)</highlight></codeline>
<codeline lineno="392"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Validate<sp/>input<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($type,<sp/>65,<sp/>73,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Barcode<sp/>type&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$len<sp/>=<sp/>strlen($content);</highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>($type)<sp/>{</highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_UPCA:</highlight></codeline>
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>11,<sp/>12,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;UPCA<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^[0-9]{11,12}$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;UPCA<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_UPCE:</highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateIntegerMulti($len,<sp/>[[6,<sp/>8],<sp/>[11,<sp/>12]],<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;UPCE<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="403"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^([0-9]{6,8}|[0-9]{11,12})$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;UPCE<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="404"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="405"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_JAN13:</highlight></codeline>
<codeline lineno="406"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>12,<sp/>13,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;JAN13<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^[0-9]{12,13}$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;JAN13<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_JAN8:</highlight></codeline>
<codeline lineno="410"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>7,<sp/>8,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;JAN8<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^[0-9]{7,8}$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;JAN8<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_CODE39:</highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>1,<sp/>255,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;CODE39<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>255<sp/>is<sp/>a<sp/>limitation<sp/>of<sp/>the<sp/>&quot;function<sp/>b&quot;<sp/>command,<sp/>not<sp/>the<sp/>barcode<sp/>format.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^([0-9A-Z<sp/>\$\%\+\-\.\/]+|\*[0-9A-Z<sp/>\$\%\+\-\.\/]+\*)$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;CODE39<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_ITF:</highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>2,<sp/>255,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;ITF<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>255<sp/>is<sp/>a<sp/>limitation<sp/>of<sp/>the<sp/>&quot;function<sp/>b&quot;<sp/>command,<sp/>not<sp/>the<sp/>barcode<sp/>format.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="419"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^([0-9]{2})+$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;ITF<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_CODABAR:</highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>1,<sp/>255,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Codabar<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>255<sp/>is<sp/>a<sp/>limitation<sp/>of<sp/>the<sp/>&quot;function<sp/>b&quot;<sp/>command,<sp/>not<sp/>the<sp/>barcode<sp/>format.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;Codabar<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_CODE93:</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>1,<sp/>255,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Code93<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>255<sp/>is<sp/>a<sp/>limitation<sp/>of<sp/>the<sp/>&quot;function<sp/>b&quot;<sp/>command,<sp/>not<sp/>the<sp/>barcode<sp/>format.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^[\\x00-\\x7F]+$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;Code93<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>self::BARCODE_CODE128:</highlight></codeline>
<codeline lineno="430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($len,<sp/>1,<sp/>255,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Code128<sp/>barcode<sp/>content<sp/>length&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>255<sp/>is<sp/>a<sp/>limitation<sp/>of<sp/>the<sp/>&quot;function<sp/>b&quot;<sp/>command,<sp/>not<sp/>the<sp/>barcode<sp/>format.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>CODE128<sp/>encoder<sp/>is<sp/>quite<sp/>complex,<sp/>so<sp/>only<sp/>a<sp/>very<sp/>basic<sp/>header-check<sp/>is<sp/>applied<sp/>here.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateStringRegex($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;/^\{[A-C][\\x00-\\x7F]+$/&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;Code128<sp/>barcode<sp/>content&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!$this<sp/>-&gt;<sp/>profile<sp/>-&gt;<sp/>getSupportsBarcodeB())<sp/>{</highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>A<sp/>simpler<sp/>barcode<sp/>command<sp/>which<sp/>supports<sp/>fewer<sp/>codes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($type,<sp/>65,<sp/>71,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;k&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($type<sp/>-<sp/>65)<sp/>.<sp/>$content<sp/>.<sp/>self::NUL);</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>More<sp/>advanced<sp/>function<sp/>B,<sp/>used<sp/>in<sp/>preference</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;k&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($type)<sp/>.<sp/>chr(strlen($content))<sp/>.<sp/>$content);</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="457"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1acbe0996aaf604bf900350a61b4e850c3" kindref="member">bitImage</ref>(<ref refid="classMike42_1_1Escpos_1_1EscposImage" kindref="compound">EscposImage</ref><sp/>$img,<sp/>$size<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aad4110ca44a49258437b73b8f69b153d" kindref="member">Printer::IMG_DEFAULT</ref>)</highlight></codeline>
<codeline lineno="458"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="459"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($size,<sp/>0,<sp/>3,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rasterData<sp/>=<sp/>$img<sp/>-&gt;<sp/>toRasterFormat();</highlight></codeline>
<codeline lineno="461"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$header<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aff221cf7cecacde4d6b61eaaf24914db" kindref="member">Printer::dataHeader</ref>([$img<sp/>-&gt;<sp/>getWidthBytes(),<sp/>$img<sp/>-&gt;<sp/>getHeight()],<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;v0&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($size)<sp/>.<sp/>$header);</highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write($rasterData);</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="465"><highlight class="normal"></highlight></codeline>
<codeline lineno="477"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa30bcbbb0a7d2b30ddfbec6ebd6e2275" kindref="member">bitImageColumnFormat</ref>(<ref refid="classMike42_1_1Escpos_1_1EscposImage" kindref="compound">EscposImage</ref><sp/>$img,<sp/>$size<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aad4110ca44a49258437b73b8f69b153d" kindref="member">Printer::IMG_DEFAULT</ref>)</highlight></codeline>
<codeline lineno="478"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$highDensityVertical<sp/>=<sp/>!<sp/>(($size<sp/>&amp;<sp/>self::IMG_DOUBLE_HEIGHT)<sp/>==<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5c3b06a2e653012fd4df0969afb490c6" kindref="member">Printer::IMG_DOUBLE_HEIGHT</ref>);</highlight></codeline>
<codeline lineno="480"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$highDensityHorizontal<sp/>=<sp/>!<sp/>(($size<sp/>&amp;<sp/>self::IMG_DOUBLE_WIDTH)<sp/>==<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a153742a99bd7b8807603a078b992b89f" kindref="member">Printer::IMG_DOUBLE_WIDTH</ref>);</highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Experimental<sp/>column<sp/>format<sp/>printing</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="482"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>This<sp/>feature<sp/>is<sp/>not<sp/>yet<sp/>complete<sp/>and<sp/>may<sp/>produce<sp/>unpredictable<sp/>results.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="483"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5eb749822b535d0cb2f7a585ff12348f" kindref="member">setLineSpacing</ref>(16);<sp/></highlight><highlight class="comment">//<sp/>16-dot<sp/>line<sp/>spacing.<sp/>This<sp/>is<sp/>the<sp/>correct<sp/>value<sp/>on<sp/>both<sp/>TM-T20<sp/>and<sp/>TM-U220</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="484"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Header<sp/>and<sp/>density<sp/>code<sp/>(0,<sp/>1,<sp/>32,<sp/>33)<sp/>re-used<sp/>for<sp/>every<sp/>line</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$densityCode<sp/>=<sp/>($highDensityHorizontal<sp/>?<sp/>1<sp/>:<sp/>0)<sp/>+<sp/>($highDensityVertical<sp/>?<sp/>32<sp/>:<sp/>0);</highlight></codeline>
<codeline lineno="486"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$colFormatData<sp/>=<sp/>$img<sp/>-&gt;<sp/>toColumnFormat($highDensityVertical);</highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$header<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aff221cf7cecacde4d6b61eaaf24914db" kindref="member">Printer::dataHeader</ref>([$img<sp/>-&gt;<sp/>getWidth()],<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">foreach</highlight><highlight class="normal"><sp/>($colFormatData<sp/>as<sp/>$line)<sp/>{</highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Print<sp/>each<sp/>line,<sp/>double<sp/>density<sp/>etc<sp/>for<sp/>printing<sp/>are<sp/>set<sp/>here<sp/>also</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="490"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;*&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($densityCode)<sp/>.<sp/>$header<sp/>.<sp/>$line);</highlight></codeline>
<codeline lineno="491"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1adcbb8caf9162585c839f4cbfd959b866" kindref="member">feed</ref>();</highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>sleep(0.1);<sp/>//<sp/>Reduces<sp/>the<sp/>amount<sp/>of<sp/>trouble<sp/>that<sp/>a<sp/>TM-U220<sp/>has<sp/>keeping<sp/>up<sp/>with<sp/>large<sp/>images</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5eb749822b535d0cb2f7a585ff12348f" kindref="member">setLineSpacing</ref>();<sp/></highlight><highlight class="comment">//<sp/>Revert<sp/>to<sp/>default<sp/>line<sp/>spacing</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="496"><highlight class="normal"></highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5e42e20e4c82a554220958651d2fcc0f" kindref="member">close</ref>()</highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>finalize();</highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="512"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a9583c7431a4c8cdf66985e53cff170f2" kindref="member">cut</ref>($mode<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a801123bac2a901104cf7caf7a7c7be04" kindref="member">Printer::CUT_FULL</ref>,<sp/>$lines<sp/>=<sp/>3)</highlight></codeline>
<codeline lineno="513"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO<sp/>validation<sp/>on<sp/>cut()<sp/>inputs</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="515"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;V&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($mode)<sp/>.<sp/>chr($lines));</highlight></codeline>
<codeline lineno="516"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="517"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="523"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1adcbb8caf9162585c839f4cbfd959b866" kindref="member">feed</ref>($lines<sp/>=<sp/>1)</highlight></codeline>
<codeline lineno="524"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="525"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($lines,<sp/>1,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($lines<sp/>&lt;=<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="527"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::LF);</highlight></codeline>
<codeline lineno="528"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;d&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($lines));</highlight></codeline>
<codeline lineno="530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="531"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="532"><highlight class="normal"></highlight></codeline>
<codeline lineno="537"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a499af2d5254b6caa0205b66809625ec2" kindref="member">feedForm</ref>()</highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::FF);</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="541"><highlight class="normal"></highlight></codeline>
<codeline lineno="545"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab5b07d6d6256ff3c27652a9ee0df253b" kindref="member">release</ref>()</highlight></codeline>
<codeline lineno="546"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="547"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/>chr(113));</highlight></codeline>
<codeline lineno="548"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="549"><highlight class="normal"></highlight></codeline>
<codeline lineno="555"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ad5d153097386d611e30498bc14a4648d" kindref="member">feedReverse</ref>($lines<sp/>=<sp/>1)</highlight></codeline>
<codeline lineno="556"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="557"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($lines,<sp/>1,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;e&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($lines));</highlight></codeline>
<codeline lineno="559"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="560"><highlight class="normal"></highlight></codeline>
<codeline lineno="564"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a745ba36359a8b2c02f9d77faf5a92ed0" kindref="member">getCharacterTable</ref>()</highlight></codeline>
<codeline lineno="565"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$this<sp/>-&gt;<sp/>characterTable;</highlight></codeline>
<codeline lineno="567"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="568"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a90af14cf7bd5801a9e3998390d1034c4" kindref="member">getPrintBuffer</ref>()</highlight></codeline>
<codeline lineno="573"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="574"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$this<sp/>-&gt;<sp/>buffer;</highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="576"><highlight class="normal"></highlight></codeline>
<codeline lineno="580"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a9a6c4faedeb147fd82bc4a25bba70b3d" kindref="member">getPrintConnector</ref>()</highlight></codeline>
<codeline lineno="581"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="582"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$this<sp/>-&gt;<sp/>connector;</highlight></codeline>
<codeline lineno="583"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="584"><highlight class="normal"></highlight></codeline>
<codeline lineno="588"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ad484b5cf27a82e24520e64c929169f6c" kindref="member">getPrinterCapabilityProfile</ref>()</highlight></codeline>
<codeline lineno="589"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="590"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$this<sp/>-&gt;<sp/>profile;</highlight></codeline>
<codeline lineno="591"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="592"><highlight class="normal"></highlight></codeline>
<codeline lineno="612"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a587d85fcf9cf91320e9efc4b028d914a" kindref="member">graphics</ref>(<ref refid="classMike42_1_1Escpos_1_1EscposImage" kindref="compound">EscposImage</ref><sp/>$img,<sp/>$size<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aad4110ca44a49258437b73b8f69b153d" kindref="member">Printer::IMG_DEFAULT</ref>)</highlight></codeline>
<codeline lineno="613"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="614"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($size,<sp/>0,<sp/>3,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="615"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rasterData<sp/>=<sp/>$img<sp/>-&gt;<sp/>toRasterFormat();</highlight></codeline>
<codeline lineno="616"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$imgHeader<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aff221cf7cecacde4d6b61eaaf24914db" kindref="member">Printer::dataHeader</ref>([$img<sp/>-&gt;<sp/>getWidth(),<sp/>$img<sp/>-&gt;<sp/>getHeight()],<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$tone<sp/>=<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$colors<sp/>=<sp/></highlight><highlight class="charliteral">&apos;1&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$xm<sp/>=<sp/>(($size<sp/>&amp;<sp/>self::IMG_DOUBLE_WIDTH)<sp/>==<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a153742a99bd7b8807603a078b992b89f" kindref="member">Printer::IMG_DOUBLE_WIDTH</ref>)<sp/>?<sp/>chr(2)<sp/>:<sp/>chr(1);</highlight></codeline>
<codeline lineno="620"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ym<sp/>=<sp/>(($size<sp/>&amp;<sp/>self::IMG_DOUBLE_HEIGHT)<sp/>==<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5c3b06a2e653012fd4df0969afb490c6" kindref="member">Printer::IMG_DOUBLE_HEIGHT</ref>)<sp/>?<sp/>chr(2)<sp/>:<sp/>chr(1);</highlight></codeline>
<codeline lineno="621"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$header<sp/>=<sp/>$tone<sp/>.<sp/>$xm<sp/>.<sp/>$ym<sp/>.<sp/>$colors<sp/>.<sp/>$imgHeader;</highlight></codeline>
<codeline lineno="622"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a782e6e368523543997bd7f275a82155a" kindref="member">wrapperSendGraphicsData</ref>(</highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">,<sp/></highlight><highlight class="charliteral">&apos;p&apos;</highlight><highlight class="normal">,<sp/>$header<sp/>.<sp/>$rasterData);</highlight></codeline>
<codeline lineno="623"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a782e6e368523543997bd7f275a82155a" kindref="member">wrapperSendGraphicsData</ref>(</highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">,<sp/></highlight><highlight class="charliteral">&apos;2&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="624"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="625"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="629"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a8ebf7acd6cb7a30f647eb7475361fab9" kindref="member">initialize</ref>()</highlight></codeline>
<codeline lineno="630"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="631"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;@&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="632"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>characterTable<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="633"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="634"><highlight class="normal"></highlight></codeline>
<codeline lineno="651"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a75fbf324ff74cb5a998b6325e1309482" kindref="member">pdf417Code</ref>($content,<sp/>$width<sp/>=<sp/>3,<sp/>$heightMultiplier<sp/>=<sp/>3,<sp/>$dataColumnCount<sp/>=<sp/>0,<sp/>$ec<sp/>=<sp/>0.10,<sp/>$options<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a786ac596e03e2086f8e534eda2ea9396" kindref="member">Printer::PDF417_STANDARD</ref>)</highlight></codeline>
<codeline lineno="652"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="653"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateString($content,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;content&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="654"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($width,<sp/>2,<sp/>8,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;width&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="655"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($heightMultiplier,<sp/>2,<sp/>8,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;heightMultiplier&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="656"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($dataColumnCount,<sp/>0,<sp/>30,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;dataColumnCount&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="657"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateFloat($ec,<sp/>0.01,<sp/>4.00,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;ec&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="658"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($options,<sp/>0,<sp/>1,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&apos;options&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="659"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($content<sp/>==<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="660"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="661"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="662"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!$this<sp/>-&gt;<sp/>profile<sp/>-&gt;<sp/>getSupportsPdf417Code())<sp/>{</highlight></codeline>
<codeline lineno="663"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO<sp/>use<sp/>software<sp/>rendering<sp/>via<sp/>a<sp/>library<sp/>instead</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="664"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(</highlight><highlight class="stringliteral">&quot;PDF417<sp/>codes<sp/>are<sp/>not<sp/>supported<sp/>on<sp/>your<sp/>printer.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="665"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="666"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$cn<sp/>=<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//<sp/>Code<sp/>type<sp/>for<sp/>pdf417<sp/>code</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="667"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Select<sp/>model:<sp/>standard<sp/>or<sp/>truncated</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="668"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(70),<sp/>$cn,<sp/>chr($options));</highlight></codeline>
<codeline lineno="669"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Column<sp/>count</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="670"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(65),<sp/>$cn,<sp/>chr($dataColumnCount));</highlight></codeline>
<codeline lineno="671"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Set<sp/>dot<sp/>sizes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="672"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(67),<sp/>$cn,<sp/>chr($width));</highlight></codeline>
<codeline lineno="673"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(68),<sp/>$cn,<sp/>chr($heightMultiplier));</highlight></codeline>
<codeline lineno="674"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Set<sp/>error<sp/>correction<sp/>ratio:<sp/>1%<sp/>to<sp/>400%</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="675"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ec_int<sp/>=<sp/>(int)ceil(floatval($ec)<sp/>*<sp/>10);</highlight></codeline>
<codeline lineno="676"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(69),<sp/>$cn,<sp/>chr($ec_int),<sp/></highlight><highlight class="charliteral">&apos;1&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="677"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Send<sp/>content<sp/>&amp;<sp/>print</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="678"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(80),<sp/>$cn,<sp/>$content,<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="679"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(81),<sp/>$cn,<sp/></highlight><highlight class="stringliteral">&apos;&apos;</highlight><highlight class="normal">,<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="680"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="681"><highlight class="normal"></highlight></codeline>
<codeline lineno="690"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a1312e0f118d42ff499d8ac06ac7ffdc2" kindref="member">pulse</ref>($pin<sp/>=<sp/>0,<sp/>$on_ms<sp/>=<sp/>120,<sp/>$off_ms<sp/>=<sp/>240)</highlight></codeline>
<codeline lineno="691"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="692"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($pin,<sp/>0,<sp/>1,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="693"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($on_ms,<sp/>1,<sp/>511,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="694"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($off_ms,<sp/>1,<sp/>511,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="695"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;p&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($pin<sp/>+<sp/>48)<sp/>.<sp/>chr($on_ms<sp/>/<sp/>2)<sp/>.<sp/>chr($off_ms<sp/>/<sp/>2));</highlight></codeline>
<codeline lineno="696"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="697"><highlight class="normal"></highlight></codeline>
<codeline lineno="706"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a02f321096ee8018f1829da1400575186" kindref="member">qrCode</ref>($content,<sp/>$ec<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af9116ea373fd8a10e73f20f6eb3c05e8" kindref="member">Printer::QR_ECLEVEL_L</ref>,<sp/>$size<sp/>=<sp/>3,<sp/>$model<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ad068f187eabd7d438f5c1b67721e9b5c" kindref="member">Printer::QR_MODEL_2</ref>)</highlight></codeline>
<codeline lineno="707"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="708"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateString($content,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($ec,<sp/>0,<sp/>3,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="710"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($size,<sp/>1,<sp/>16,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="711"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($model,<sp/>1,<sp/>3,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="712"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($content<sp/>==<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="713"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="714"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="715"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!$this<sp/>-&gt;<sp/>profile<sp/>-&gt;<sp/>getSupportsQrCode())<sp/>{</highlight></codeline>
<codeline lineno="716"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO<sp/>use<sp/>software<sp/>rendering<sp/>via<sp/>phpqrcode<sp/>instead</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="717"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(</highlight><highlight class="stringliteral">&quot;QR<sp/>codes<sp/>are<sp/>not<sp/>supported<sp/>on<sp/>your<sp/>printer.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="718"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="719"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$cn<sp/>=<sp/></highlight><highlight class="charliteral">&apos;1&apos;</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//<sp/>Code<sp/>type<sp/>for<sp/>QR<sp/>code</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="720"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Select<sp/>model:<sp/>1,<sp/>2<sp/>or<sp/>micro.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="721"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(65),<sp/>$cn,<sp/>chr(48<sp/>+<sp/>$model)<sp/>.<sp/>chr(0));</highlight></codeline>
<codeline lineno="722"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Set<sp/>dot<sp/>size.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="723"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(67),<sp/>$cn,<sp/>chr($size));</highlight></codeline>
<codeline lineno="724"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Set<sp/>error<sp/>correction<sp/>level:<sp/>L,<sp/>M,<sp/>Q,<sp/>or<sp/>H</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="725"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(69),<sp/>$cn,<sp/>chr(48<sp/>+<sp/>$ec));</highlight></codeline>
<codeline lineno="726"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Send<sp/>content<sp/>&amp;<sp/>print</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="727"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(80),<sp/>$cn,<sp/>$content,<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="728"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>(chr(81),<sp/>$cn,<sp/></highlight><highlight class="stringliteral">&apos;&apos;</highlight><highlight class="normal">,<sp/></highlight><highlight class="charliteral">&apos;0&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="729"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="730"><highlight class="normal"></highlight></codeline>
<codeline lineno="737"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a356cd65ed1599aa4749820400d801786" kindref="member">selectCharacterTable</ref>($table<sp/>=<sp/>0)</highlight></codeline>
<codeline lineno="738"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="739"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($table,<sp/>0,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="740"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$supported<sp/>=<sp/>$this<sp/>-&gt;<sp/>profile<sp/>-&gt;<sp/>getCodePages();</highlight></codeline>
<codeline lineno="741"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!isset($supported[$table]))<sp/>{</highlight></codeline>
<codeline lineno="742"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;There<sp/>is<sp/>no<sp/>code<sp/>table<sp/>$table<sp/>allowed<sp/>by<sp/>this<sp/>printer&apos;s<sp/>capability<sp/>profile.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="743"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="744"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>characterTable<sp/>=<sp/>$table;</highlight></codeline>
<codeline lineno="745"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>profile<sp/>-&gt;<sp/>getSupportsStarCommands())<sp/>{</highlight></codeline>
<codeline lineno="746"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Not<sp/>an<sp/>ESC/POS<sp/>command:<sp/>STAR<sp/>printers<sp/>stash<sp/>all<sp/>the<sp/>extra<sp/>code<sp/>pages<sp/>under<sp/>a<sp/>different<sp/>command.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="747"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/>self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;t&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($table));</highlight></codeline>
<codeline lineno="748"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="749"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="750"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;t&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($table));</highlight></codeline>
<codeline lineno="751"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="752"><highlight class="normal"></highlight></codeline>
<codeline lineno="766"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a8ab3e1bd33fcd36b555c63f157ea5f8d" kindref="member">selectPrintMode</ref>($mode<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1abe0bc707395eab85b236e06d83002cff" kindref="member">Printer::MODE_FONT_A</ref>)</highlight></codeline>
<codeline lineno="767"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="768"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$allModes<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af0e9c20dc3ad99574315272d1c7fb099" kindref="member">Printer::MODE_FONT_B</ref><sp/>|<sp/>self::MODE_EMPHASIZED<sp/>|<sp/>self::MODE_DOUBLE_HEIGHT<sp/>|<sp/>self::MODE_DOUBLE_WIDTH<sp/>|<sp/>self::MODE_UNDERLINE;</highlight></codeline>
<codeline lineno="769"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!is_integer($mode)<sp/>||<sp/>$mode<sp/>&lt;<sp/>0<sp/>||<sp/>($mode<sp/>&amp;<sp/>$allModes)<sp/>!=<sp/>$mode)<sp/>{</highlight></codeline>
<codeline lineno="770"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;Invalid<sp/>mode&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="771"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="772"><highlight class="normal"></highlight></codeline>
<codeline lineno="773"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;!&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($mode));</highlight></codeline>
<codeline lineno="774"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="775"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="781"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a0870574d4450c7b3d307f0e2edd45490" kindref="member">setBarcodeHeight</ref>($height<sp/>=<sp/>8)</highlight></codeline>
<codeline lineno="782"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="783"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($height,<sp/>1,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="784"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;h&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($height));</highlight></codeline>
<codeline lineno="785"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="786"><highlight class="normal"></highlight></codeline>
<codeline lineno="793"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a9db808a4b69553f08a9ccf3db35fcf80" kindref="member">setBarcodeWidth</ref>($width<sp/>=<sp/>3)</highlight></codeline>
<codeline lineno="794"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="795"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($width,<sp/>1,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="796"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;w&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($width));</highlight></codeline>
<codeline lineno="797"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="798"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="806"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a14a3ecefddceaa02b8f6686f3e66fdd1" kindref="member">setBarcodeTextPosition</ref>($position<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a75616e46e6eb86fc6b2ac952c1f8c836" kindref="member">Printer::BARCODE_TEXT_NONE</ref>)</highlight></codeline>
<codeline lineno="807"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="808"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($position,<sp/>0,<sp/>3,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Barcode<sp/>text<sp/>position&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="809"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;H&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($position));</highlight></codeline>
<codeline lineno="810"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="811"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="817"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aba83b7c4ccad02d86337533b4b0c1b6b" kindref="member">setDoubleStrike</ref>($on<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="818"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="819"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateBoolean($on,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="820"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;G&quot;</highlight><highlight class="normal">.<sp/>($on<sp/>?<sp/>chr(1)<sp/>:<sp/>chr(0)));</highlight></codeline>
<codeline lineno="821"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="822"><highlight class="normal"></highlight></codeline>
<codeline lineno="828"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a1896c57208fb82cc30f0f8702e2fc358" kindref="member">setColor</ref>($color<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1af7a526c77a779d7795ce2e9c6e371c64" kindref="member">Printer::COLOR_1</ref>)</highlight></codeline>
<codeline lineno="829"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="830"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($color,<sp/>0,<sp/>1,<sp/>__FUNCTION__,<sp/></highlight><highlight class="stringliteral">&quot;Color&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="831"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;r&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($color));</highlight></codeline>
<codeline lineno="832"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="833"><highlight class="normal"></highlight></codeline>
<codeline lineno="839"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a42ed9de6f0b5bfe8fd3ebb9a02d4a291" kindref="member">setEmphasis</ref>($on<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="840"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="841"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateBoolean($on,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="842"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;E&quot;</highlight><highlight class="normal">.<sp/>($on<sp/>?<sp/>chr(1)<sp/>:<sp/>chr(0)));</highlight></codeline>
<codeline lineno="843"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="844"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="850"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aedc1116a73050d0034fecc78793f20d8" kindref="member">setFont</ref>($font<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a2872ec5593e654db593a1e7d208b4097" kindref="member">Printer::FONT_A</ref>)</highlight></codeline>
<codeline lineno="851"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="852"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($font,<sp/>0,<sp/>2,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="853"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;M&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($font));</highlight></codeline>
<codeline lineno="854"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="855"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="861"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a623c22bb1d472560f939040b1b920c86" kindref="member">setJustification</ref>($justification<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a207e6bd79fcabbf0103c6545e7bfd1a3" kindref="member">Printer::JUSTIFY_LEFT</ref>)</highlight></codeline>
<codeline lineno="862"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="863"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($justification,<sp/>0,<sp/>2,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="864"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;a&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($justification));</highlight></codeline>
<codeline lineno="865"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="866"><highlight class="normal"></highlight></codeline>
<codeline lineno="875"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5eb749822b535d0cb2f7a585ff12348f" kindref="member">setLineSpacing</ref>($height<sp/>=<sp/>null)</highlight></codeline>
<codeline lineno="876"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="877"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($height<sp/>===<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="878"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Reset<sp/>to<sp/>default</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="879"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;2&quot;</highlight><highlight class="normal">);<sp/></highlight><highlight class="comment">//<sp/>Revert<sp/>to<sp/>default<sp/>line<sp/>spacing</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="880"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="881"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="882"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($height,<sp/>1,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="883"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;3&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($height));</highlight></codeline>
<codeline lineno="884"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="885"><highlight class="normal"></highlight></codeline>
<codeline lineno="891"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a039c6afb1d8870a9c480bb24143a34c7" kindref="member">setPrintLeftMargin</ref>($margin<sp/>=<sp/>0)</highlight></codeline>
<codeline lineno="892"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="893"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($margin,<sp/>0,<sp/>65535,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="894"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(<ref refid="classMike42_1_1Escpos_1_1Printer_1a6862c6d42553030543b994fdcd29900e" kindref="member">Printer::GS</ref><sp/>.<sp/></highlight><highlight class="charliteral">&apos;L&apos;</highlight><highlight class="normal"><sp/>.<sp/>self::intLowHigh($margin,<sp/>2));</highlight></codeline>
<codeline lineno="895"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="896"><highlight class="normal"></highlight></codeline>
<codeline lineno="903"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a533e9f082ba985461d1ee40a751cffa7" kindref="member">setPrintWidth</ref>($width<sp/>=<sp/>512)</highlight></codeline>
<codeline lineno="904"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="905"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($width,<sp/>1,<sp/>65535,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="906"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(<ref refid="classMike42_1_1Escpos_1_1Printer_1a6862c6d42553030543b994fdcd29900e" kindref="member">Printer::GS</ref><sp/>.<sp/></highlight><highlight class="charliteral">&apos;W&apos;</highlight><highlight class="normal"><sp/>.<sp/>self::intLowHigh($width,<sp/>2));</highlight></codeline>
<codeline lineno="907"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="908"><highlight class="normal"></highlight></codeline>
<codeline lineno="915"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a20152d828bb33ea42de9718f7c0da1dc" kindref="member">setPrintBuffer</ref>(<ref refid="interfaceMike42_1_1Escpos_1_1PrintBuffers_1_1PrintBuffer" kindref="compound">PrintBuffer</ref><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aaca2df4c970a1e5c6af4699e5cb2f4b4" kindref="member">$buffer</ref>)</highlight></codeline>
<codeline lineno="916"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="917"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($buffer<sp/>===<sp/>$this<sp/>-&gt;<sp/>buffer)<sp/>{</highlight></codeline>
<codeline lineno="918"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="919"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="920"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($buffer<sp/>-&gt;<sp/>getPrinter()<sp/>!=<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="921"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;This<sp/>buffer<sp/>is<sp/>already<sp/>attached<sp/>to<sp/>a<sp/>printer.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="922"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="923"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>buffer<sp/>!==<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="924"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>-&gt;<sp/>setPrinter(null);</highlight></codeline>
<codeline lineno="925"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="926"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aaca2df4c970a1e5c6af4699e5cb2f4b4" kindref="member">$buffer</ref>;</highlight></codeline>
<codeline lineno="927"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>-&gt;<sp/>setPrinter($this);</highlight></codeline>
<codeline lineno="928"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="929"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="935"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ab4db7e9634db9b3ebf0a02a87a43ecf0" kindref="member">setReverseColors</ref>($on<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="936"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="937"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateBoolean($on,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="938"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;B&quot;</highlight><highlight class="normal"><sp/>.<sp/>($on<sp/>?<sp/>chr(1)<sp/>:<sp/>chr(0)));</highlight></codeline>
<codeline lineno="939"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="940"><highlight class="normal"></highlight></codeline>
<codeline lineno="947"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aca114b1fcba0a466abcde38e3ce3b85f" kindref="member">setTextSize</ref>($widthMultiplier,<sp/>$heightMultiplier)</highlight></codeline>
<codeline lineno="948"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="949"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($widthMultiplier,<sp/>1,<sp/>8,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="950"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($heightMultiplier,<sp/>1,<sp/>8,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="951"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$c<sp/>=<sp/>pow(2,<sp/>4)<sp/>*<sp/>($widthMultiplier<sp/>-<sp/>1)<sp/>+<sp/>($heightMultiplier<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="952"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;!&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($c));</highlight></codeline>
<codeline lineno="953"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="954"><highlight class="normal"></highlight></codeline>
<codeline lineno="963"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a969b7c33a4af699d027f161b956928a8" kindref="member">setUnderline</ref>($underline<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aeeaea6359c8febd8884b89b45e339248" kindref="member">Printer::UNDERLINE_SINGLE</ref>)</highlight></codeline>
<codeline lineno="964"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="965"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Map<sp/>true/false<sp/>to<sp/>underline<sp/>constants<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="966"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($underline<sp/>===<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="967"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$underline<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aeeaea6359c8febd8884b89b45e339248" kindref="member">Printer::UNDERLINE_SINGLE</ref>;</highlight></codeline>
<codeline lineno="968"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/>elseif<sp/>($underline<sp/>===<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="969"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$underline<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5904b8b6661aeaa3f10ff4c3e4328403" kindref="member">Printer::UNDERLINE_NONE</ref>;</highlight></codeline>
<codeline lineno="970"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="971"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>the<sp/>underline<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="972"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($underline,<sp/>0,<sp/>2,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="973"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;-&quot;</highlight><highlight class="normal"><sp/>.<sp/>chr($underline));</highlight></codeline>
<codeline lineno="974"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="975"><highlight class="normal"></highlight></codeline>
<codeline lineno="981"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a71ea6b1923736bc1d1076b7a8e4e175e" kindref="member">setUpsideDown</ref>($on<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="982"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="983"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateBoolean($on,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="984"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::ESC<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;{&quot;</highlight><highlight class="normal"><sp/>.<sp/>($on<sp/>?<sp/>chr(1)<sp/>:<sp/>chr(0)));</highlight></codeline>
<codeline lineno="985"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="986"><highlight class="normal"></highlight></codeline>
<codeline lineno="995"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1ac163b314681d36e9bb9dd75fb644e847" kindref="member">text</ref>($str<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="996"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="997"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateString($str,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="998"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>-&gt;<sp/>writeText((</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">)$str);</highlight></codeline>
<codeline lineno="999"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1000"><highlight class="normal"></highlight></codeline>
<codeline lineno="1008"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aab6c49586fc5bda93a3b3c8572a2adf6" kindref="member">textChinese</ref>($str<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1009"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1010"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateString($str,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="1011"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::FS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;&amp;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1012"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$str<sp/>=<sp/>iconv(</highlight><highlight class="stringliteral">&quot;UTF-8&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;GBK//IGNORE&quot;</highlight><highlight class="normal">,<sp/>$str);</highlight></codeline>
<codeline lineno="1013"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>-&gt;<sp/>writeTextRaw((</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">)$str);</highlight></codeline>
<codeline lineno="1014"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::FS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1015"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1016"><highlight class="normal"></highlight></codeline>
<codeline lineno="1025"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1afaba4cf26d1d40d9d9c6b6b338a9ccfc" kindref="member">textRaw</ref>($str<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1026"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1027"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateString($str,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="1028"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>buffer<sp/>-&gt;<sp/>writeTextRaw((</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">)$str);</highlight></codeline>
<codeline lineno="1029"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1030"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1040"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aa1b2ba0d6e235c09be6e88832743c454" kindref="member">wrapperSend2dCodeData</ref>($fn,<sp/>$cn,<sp/>$data<sp/>=<sp/></highlight><highlight class="stringliteral">&apos;&apos;</highlight><highlight class="normal">,<sp/>$m<sp/>=<sp/></highlight><highlight class="stringliteral">&apos;&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1041"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1042"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen($m)<sp/>&gt;<sp/>1<sp/>||<sp/>strlen($cn)<sp/>!=<sp/>1<sp/>||<sp/>strlen($fn)<sp/>!=<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="1043"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;wrapperSend2dCodeData:<sp/>cn<sp/>and<sp/>fn<sp/>must<sp/>be<sp/>one<sp/>character<sp/>each.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1044"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1045"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$header<sp/>=<sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a912ba4a5e675fd674d947d921d87db54" kindref="member">intLowHigh</ref>(strlen($data)<sp/>+<sp/>strlen($m)<sp/>+<sp/>2,<sp/>2);</highlight></codeline>
<codeline lineno="1046"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;(k&quot;</highlight><highlight class="normal"><sp/>.<sp/>$header<sp/>.<sp/>$cn<sp/>.<sp/>$fn<sp/>.<sp/>$m<sp/>.<sp/>$data);</highlight></codeline>
<codeline lineno="1047"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1048"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1057"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a782e6e368523543997bd7f275a82155a" kindref="member">wrapperSendGraphicsData</ref>($m,<sp/>$fn,<sp/>$data<sp/>=<sp/></highlight><highlight class="stringliteral">&apos;&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1058"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1059"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen($m)<sp/>!=<sp/>1<sp/>||<sp/>strlen($fn)<sp/>!=<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="1060"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;wrapperSendGraphicsData:<sp/>m<sp/>and<sp/>fn<sp/>must<sp/>be<sp/>one<sp/>character<sp/>each.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1061"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1062"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$header<sp/>=<sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a912ba4a5e675fd674d947d921d87db54" kindref="member">intLowHigh</ref>(strlen($data)<sp/>+<sp/>2,<sp/>2);</highlight></codeline>
<codeline lineno="1063"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>connector<sp/>-&gt;<sp/>write(self::GS<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;(L&quot;</highlight><highlight class="normal"><sp/>.<sp/>$header<sp/>.<sp/>$m<sp/>.<sp/>$fn<sp/>.<sp/>$data);</highlight></codeline>
<codeline lineno="1064"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1065"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1073"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1aff221cf7cecacde4d6b61eaaf24914db" kindref="member">dataHeader</ref>(array<sp/>$inputs,<sp/>$long<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1074"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1075"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$outp<sp/>=<sp/>[];</highlight></codeline>
<codeline lineno="1076"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">foreach</highlight><highlight class="normal"><sp/>($inputs<sp/>as<sp/>$input)<sp/>{</highlight></codeline>
<codeline lineno="1077"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($long)<sp/>{</highlight></codeline>
<codeline lineno="1078"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$outp[]<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a912ba4a5e675fd674d947d921d87db54" kindref="member">Printer::intLowHigh</ref>($input,<sp/>2);</highlight></codeline>
<codeline lineno="1079"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="1080"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($input,<sp/>0,<sp/>255,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="1081"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$outp[]<sp/>=<sp/>chr($input);</highlight></codeline>
<codeline lineno="1082"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1083"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1084"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>implode(</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,<sp/>$outp);</highlight></codeline>
<codeline lineno="1085"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1086"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1093"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a912ba4a5e675fd674d947d921d87db54" kindref="member">intLowHigh</ref>($input,<sp/>$length)</highlight></codeline>
<codeline lineno="1094"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1095"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$maxInput<sp/>=<sp/>(256<sp/>&lt;&lt;<sp/>($length<sp/>*<sp/>8)<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="1096"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($length,<sp/>1,<sp/>4,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="1097"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateInteger($input,<sp/>0,<sp/>$maxInput,<sp/>__FUNCTION__);</highlight></codeline>
<codeline lineno="1098"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$outp<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1099"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>($i<sp/>=<sp/>0;<sp/>$i<sp/>&lt;<sp/>$length;<sp/>$i++)<sp/>{</highlight></codeline>
<codeline lineno="1100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$outp<sp/>.=<sp/>chr($input<sp/>%<sp/>256);</highlight></codeline>
<codeline lineno="1101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$input<sp/>=<sp/>(int)($input<sp/>/<sp/>256);</highlight></codeline>
<codeline lineno="1102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$outp;</highlight></codeline>
<codeline lineno="1104"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1105"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1112"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1abc8d796181b1a2b05bebcf9313c72109" kindref="member">validateBoolean</ref>($test,<sp/>$source)</highlight></codeline>
<codeline lineno="1113"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!($test<sp/>===<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>||<sp/>$test<sp/>===<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">))<sp/>{</highlight></codeline>
<codeline lineno="1115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;Argument<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>a<sp/>boolean&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1117"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1118"><highlight class="normal"></highlight></codeline>
<codeline lineno="1128"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a78ed3d28c46b4b3853f5a0bb3bb7075d" kindref="member">validateFloat</ref>($test,<sp/>$min,<sp/>$max,<sp/>$source,<sp/>$argument<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Argument&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1129"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!is_numeric($test))<sp/>{</highlight></codeline>
<codeline lineno="1131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>given<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>a<sp/>float,<sp/>but<sp/>&apos;$test&apos;<sp/>was<sp/>given.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($test<sp/>&lt;<sp/>$min<sp/>||<sp/>$test<sp/>&gt;<sp/>$max)<sp/>{</highlight></codeline>
<codeline lineno="1134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>given<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>in<sp/>range<sp/>$min<sp/>to<sp/>$max,<sp/>but<sp/>$test<sp/>was<sp/>given.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1136"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1137"><highlight class="normal"></highlight></codeline>
<codeline lineno="1147"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a0e4207cf1e0eb5b1e794151d136a45b9" kindref="member">validateInteger</ref>($test,<sp/>$min,<sp/>$max,<sp/>$source,<sp/>$argument<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Argument&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1148"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>self::validateIntegerMulti($test,<sp/>[[$min,<sp/>$max]],<sp/>$source,<sp/>$argument);</highlight></codeline>
<codeline lineno="1150"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1151"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1161"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a774f415ccedce1c9bc2e8475e4ba9eb8" kindref="member">validateIntegerMulti</ref>($test,<sp/>array<sp/>$ranges,<sp/>$source,<sp/>$argument<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Argument&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1162"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!is_integer($test))<sp/>{</highlight></codeline>
<codeline lineno="1164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>given<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>a<sp/>number,<sp/>but<sp/>&apos;$test&apos;<sp/>was<sp/>given.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$match<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">foreach</highlight><highlight class="normal"><sp/>($ranges<sp/>as<sp/>$range)<sp/>{</highlight></codeline>
<codeline lineno="1168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$match<sp/>|=<sp/>$test<sp/>&gt;=<sp/>$range[0]<sp/>&amp;&amp;<sp/>$test<sp/>&lt;=<sp/>$range[1];</highlight></codeline>
<codeline lineno="1169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!$match)<sp/>{</highlight></codeline>
<codeline lineno="1171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Put<sp/>together<sp/>a<sp/>good<sp/>error<sp/>&quot;range<sp/>1-2<sp/>or<sp/>4-6&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rangeStr<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;range<sp/>&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>($i<sp/>=<sp/>0;<sp/>$i<sp/>&lt;<sp/>count($ranges);<sp/>$i++)<sp/>{</highlight></codeline>
<codeline lineno="1174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rangeStr<sp/>.=<sp/>$ranges[$i][0]<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;-&quot;</highlight><highlight class="normal"><sp/>.<sp/>$ranges[$i][1];</highlight></codeline>
<codeline lineno="1175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($i<sp/>==<sp/>count($ranges)<sp/>-<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="1176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/>elseif<sp/>($i<sp/>==<sp/>count($ranges)<sp/>-<sp/>2)<sp/>{</highlight></codeline>
<codeline lineno="1178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rangeStr<sp/>.=<sp/></highlight><highlight class="stringliteral">&quot;<sp/>or<sp/>&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="1180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rangeStr<sp/>.=<sp/></highlight><highlight class="stringliteral">&quot;,<sp/>&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>given<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>in<sp/>$rangeStr,<sp/>but<sp/>$test<sp/>was<sp/>given.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1185"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1186"><highlight class="normal"></highlight></codeline>
<codeline lineno="1195"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a5da656160e8f5086b6132ace9666411c" kindref="member">validateString</ref>($test,<sp/>$source,<sp/>$argument<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Argument&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1196"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(is_object($test)<sp/>&amp;&amp;<sp/>!method_exists($test,<sp/></highlight><highlight class="stringliteral">&apos;__toString&apos;</highlight><highlight class="normal">))<sp/>{</highlight></codeline>
<codeline lineno="1198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>to<sp/>$source<sp/>must<sp/>be<sp/>a<sp/>string&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1200"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1201"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="1211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1Printer_1a24848ec61ce4f769cda91c96829e6f9e" kindref="member">validateStringRegex</ref>($test,<sp/>$source,<sp/>$regex,<sp/>$argument<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Argument&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="1212"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(preg_match($regex,<sp/>$test)<sp/>===<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="1214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceInvalidArgumentException" kindref="compound">InvalidArgumentException</ref>(</highlight><highlight class="stringliteral">&quot;$argument<sp/>given<sp/>to<sp/>$source<sp/>is<sp/>invalid.<sp/>It<sp/>should<sp/>match<sp/>regex<sp/>&apos;$regex&apos;,<sp/>but<sp/>&apos;$test&apos;<sp/>was<sp/>given.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1216"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1217"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="C:/www/aplusnet/incahellas.com/public_html/lib/escpos-php-development/src/Mike42/Escpos/Printer.php"/>
  </compounddef>
</doxygen>
