Nascent Personality Manifestation

    cordova-plugin-mobiprint

    5.1.1 • Public • Published

    cordova-plugin-mobiprint

    This is a simple unofficial plugin to enable basic printing functionality on the mobiwire mobiprint3 device

    Feel free to make contributions to the package.

    To install

    ionic cordova plugin add cordova-plugin-mobiprint

    To print basic text

    After the 'deviceready' event

    cordova.plugins.mobiprint.print(String txt, Function success_callback, Function error_callback)

    e.g

    //@ Define the success callback
    const success = ( msg ) => {
        //@ do something
    };
    
    //@ Define the error/alternative callback 
    const error     = err_msg => {
        //@ do something else
    };
    
    //@ Print 
    cordova.plugins.mobiprint.print( 'Hello Printer!', success, error);
    
    //@Terminate the printing session
    cordova.plugins.mobiprint.end(success,err);
    
    //! That's about all
    

    To print an image/bitmap

    After the 'deviceready' event

    cordova.plugins.mobiprint.custom(String text, int font_level[1->5], Function success_callback, Function error_callback)

    e.g

    //@ Define the success callback
    const success = ( msg ) => {
        //@ do something
    };
    
    //@ Define the error/alternative callback 
    const error     = err_msg => {
        //@ do something else
    };
    
    //@ Print 
    cordova.plugins.mobiprint.custom( 'Bixbyte', 5 ,success, error);
    
    //@Terminate the printing session
    cordova.plugins.mobiprint.end(success,err);
    
    //! That's about all
    

    To print an image/bitmap

    After the 'deviceready' event

    cordova.plugins.mobiprint.printImage(String image_src, Function success_callback, Function error_callback)

    e.g

    //@ Define the success callback
    const success = ( msg ) => {
        //@ do something
    };
    
    //@ Define the error/alternative callback 
    const error     = err_msg => {
        //@ do something else
    };
    
    //@ Print 
    cordova.plugins.mobiprint.printImage( ImageData  ,success, error);
    
    //@Terminate the printing session
    cordova.plugins.mobiprint.end(success,err);
    
    //! That's about all
    

    To check if paper is loaded (or if is in printer mode)

    After the 'deviceready' event

    cordova.plugins.mobiprint.checkPaper('',Function success_callback, Function error_callback)

    To print a space

    After the 'deviceready' event

    cordova.plugins.mobiprint.space(Function success_callback, Function error_callback)

    End the printing session

    After the 'deviceready' event

    cordova.plugins.mobiprint.end(Function success_callback, Function error_callback)

    Keywords

    none

    Install

    npm i cordova-plugin-mobiprint

    DownloadsWeekly Downloads

    6

    Version

    5.1.1

    License

    ISC

    Unpacked Size

    64.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • ianmin2