Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:04:20+00:00 2026-06-17T18:04:20+00:00

I am sending the text to the bluetooth printer via my android cell. Both

  • 0

I am sending the text to the bluetooth printer via my android cell. Both the printer and my device are connected via the bluetooth.
It’s Working fine and I am getting the desired text on the paper.

My question is:

The printer is taking the default font size of the text. I want to change the font size of the text which is to be printed.

How can i achieve this??

Here is my code of printing the text after the bloutooth connectivity:

private void connect_print(BluetoothDevice bluetoothDevicess)  {
    // some code
    printData();
    // some code
}

The printData() method

private void printData() {
    // TODO Auto-generated method stub
    String str = new String("This is the text sending to the printer");
    String newline = "\n";
    try {
        out.write(str.getBytes(),0,str.getBytes().length);
        Log.i("Log", "One line printed");
    } catch (IOException e) {
        Toast.makeText(BluetoothDemo.this, "catch 1", Toast.LENGTH_LONG).show();
        e.printStackTrace();
        Log.i("Log", "unable to write ");
        flagCheck = false;
    }
    try {
        out.write(newline.getBytes(),0,newline.getBytes().length);
    } catch (IOException e) {        
        Log.i("Log", "Unable to write the new line::");
        e.printStackTrace();
        flagCheck = false;
    }
    flagCheck = true;
}

I want to change the font size and the font style of the text which is sending to the printer to print.
Please help me to achieve this.
If anyone can suggest any link then too i will appreciate him/her.
Help me to find the solution to this problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:04:22+00:00Added an answer on June 17, 2026 at 6:04 pm

    Hi you write on my answer of the same theme this:

    I have already asked the same question in this thread HERE, but didnt
    yet got any response. Got only one answer but it was not helped me.

    Let see whether it help you. HERE

    If you have done with it then please answer me in my thread. I will
    definitely appreciate you.

    Now I konw how to do it, i had to apply reverse ingeneering and decompile an .apk from the market, using dex2jar on linux and next opening jar with java decompiler… Try this… when u write this command:

    out.write(str.getBytes(),0,str.getBytes().length);

    U are sending to the method an byte[] array, u can modify format sending another byte[] array before send the real byte[] array…

    The default format byte[] array is this:

    byte[] arrayOfByte1 = { 27, 33, 0 };

    So u can try this:

    byte[] format = { 27, 33, 0 };
    
    out.write(format);
    
    out.write(str.getBytes(),0,str.getBytes().length);
    

    These lines i’ll print u the default format text, but uf u do it:

     byte[] format = { 27, 33, 0 };
    
    format[2] = ((byte)(0x8 | arrayOfByte1[2]));
    
    out.write(format);
    
    out.write(str.getBytes(),0,str.getBytes().length);
    

    It will print text in bold style… U can try this oter format arrays:

                // Bold
                format[2] = ((byte)(0x8 | arrayOfByte1[2]));
    
                // Height
                format[2] = ((byte)(0x10 | arrayOfByte1[2]));
    
                // Width
                format[2] = ((byte) (0x20 | arrayOfByte1[2]));
    
                // Underline
                format[2] = ((byte)(0x80 | arrayOfByte1[2]));
    
                // Small
                format[2] = ((byte)(0x1 | arrayOfByte1[2]));
    

    Too u can combine it, then if u like little and bold text, uncomment these array asignements, for example:

     byte[] format = { 27, 33, 0 };
    
        // Bold
    format[2] = ((byte)(0x8 | arrayOfByte1[2]));
    // Height
    format[2] = ((byte)(0x10 | arrayOfByte1[2]));
    // Width
    format[2] = ((byte) (0x20 | arrayOfByte1[2]));
    // Underline
    // format[2] = ((byte)(0x80 | arrayOfByte1[2]));
    // Small
    // format[2] = ((byte)(0x1 | arrayOfByte1[2]));
        out.write(format);
        out.write(str.getBytes(),0,str.getBytes().length);
    

    This last code prints que biggest text size… I hope this can helps u…

    Pdta: sorry for my english

    Pdta2: I’m trying to print images, u know how??

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've problem with Editing EDIT window (both by writing or sending text to it).
In my app I am using MFMessageComposeViewController for sending text messages. It worked fine
sending text to label and number to int from tabelview to viewcontroller but it
I've used ColdFusion for sending text emails for years. I'm now interested in learning
Hi Is there any way to block my iPhone from calling/sending text to a
I am sending password text to the http service request object.like <request><password>pass.text</password></request> now this
I'm sending a large amount of text to my webpage by POST that's received
I am sending UTF-8, japanese text, to my server. It works in Firefox. My
I am sending mails (in asp.net ,c#), having a template in text file (.txt)
Sending XML from C# Server and receiving it it in Android Java client This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.