• Resolved gunlok123

    (@gunlok123)


    HI,
    First of all good job the plugin very good. I just wondering because our printer STAR SP700 allows printing in two colours black and red are there any settings or code which allow changing text colour?
    I know that for example
    $printer->set_text_emphasized();
    make text bold, so I wondering if there any for changing colour.
    Thank you,
    Michal

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @gunlok123 currently there is no option, since the focus is almost entirely on thermal printers these days, even in kitchens. But it is quite easy to add, as long as you are able to modify the order-handler.php part to adjust the template as you need?

    Thread Starter gunlok123

    (@gunlok123)

    Thanks @lawrenceowen
    Yes, of course, I’m able to modify the file. What should I add to make it print the colour?

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @gunlok123

    Please add the following functions to “cloudprnt/printer_star_line.inc.php” and “cloudprnt/printer_star_prnt.inc.php”

    public function set_text_highlight()
    {
    	$this->printJobBuilder .= "1B34";
    }
    
    public function cancel_text_highlight()
    {
    	$this->printJobBuilder .= "1B35";
    }

    And ideally, add empty functions with the same names to “cloudprnt/printer_text_plain.inc.php”. Really, you only really need to modify the first file, but modifying the others ensures that you won’t have a problem if you ever connect a different printer model.

    You can then call $printer->set_text_highlight() and $printer->cancel_text_highlight() as needed from within the “order-handler.php” code. On printers with two colour printing support like your SP700, text will be printed as red, on other models it will be printed as reversed, white-on-black text.

    Thread Starter gunlok123

    (@gunlok123)

    Thank you @lawrenceowen
    I’ll test it and let you know

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @gunlok123 I’m assuming that all went well and marking this as resolved, but please let us know if you have any trouble.

    As a convenience, the set_text_highlight() and cancel_text_highlight() are included in the base version of the plugin from 2.0.3 which was released yesterday.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Change text colour’ is closed to new replies.