7 Replies Latest reply on May 4, 2013 3:34 AM by Guillermo James

    Printing using Bluetooth and APD - Android.

    Guillermo James

      Hi. I am trying to implement printing in a rhoelements application from a motorola device MC40. I am new in printing functionality from rhoelements and i have read that APD could be a good option.  Do you know about some sample codes. I am actually working with RhoStudio.

       

      Thanks in advance.

      Guillermo.

        • Re: Printing using Bluetooth and APD - Android.
          Glenn Sayer

          I attached the APD documentation.  Only certain printers are supported via APD.  Another option is to open a BT connection and talk to the printer directly.

          1 of 1 people found this helpful
          • Re: Printing using Bluetooth and APD - Android.
            Robin West

            Hi Guillermo,

            Think of the APD as a printer driver. 

             

            First you have to tell the driver where the printer is.

            apd.PSExternal(261, PID);

            The PID can be found using the Print Type Codes Manual

             

            Second you need to create your print job.  The way this job is created is specific to the printer you are using.  See the printer manufacturers website for information on how to do this.  Since I'm a Zebra person, I use ZPL language to create labels. 

            ^XA^F020,20^A0N,30,30^FDTEST^FS^XZ

             

            Third you send the print job to the printer

            apd.PSExternal(266, "^XA^F020,20^A0N,30,30^FDTEST^FS^XZ");

             

            Code looks like:

            <script type="text/javascript">

            function printTest(bluetoothMac)

            {

                 apd.PSExternal(261,"BZ40:1|" + bluetoothMac);

                 apd.PSExternal(266, "^XA^F020,20^A0N,30,30^FDTEST^FS^XZ");

            }

            </script>

             

            This is the most basic way to use the APD to print.  Once you have done this, I highly recommend trying to create templates and use the APD to dynamically pick printers.  Information for how to do this is documented well in the APD manuals.  Templates will allow your users to switch printers and use dynamic data.

             

            There are other options for printing but using the APD is the easiest.  Other methods give more feedback from the printer.

            1 of 1 people found this helpful