How to Convert HTML to String android and print that string

Question

I followed this/this to Print Receipts in part of POS(Point of Sale) from EPSON Printer

Here I am getting data Json from URL..Inside the Json Object I am getting Html print templete... like this.

{
    "response": {
        "status": "<table>.... </table>"
    }
}

so with intent I used the Above json response to a string and converted it to html...

method = "addFeedLine";
        mPrinter.addFeedLine(1);

        textData.append("Test print Sample stirng\n");**//this is sample text**

        textData.append(Html.fromHtml(status + "\n"));**//this is JSON response which is northing but HTML code, SO I am converting it to stirng**

Over there I have used status as the string so that what ever the content in side that string is printed..

If its is not a html just a plain text I will print like this

method = "addFeedLine";
mPrinter.addFeedLine(1);
textData.append(status);

Here Inside the status entire JSON data is there like below

"status": "The store list Sample\nSTORE DIRECTOR – XYZ\n01/01/01 16:58 6153 05 0191 134\nST# 21 OP# 001 TE# 01 TR# 747\n------------------------------\n400 OHEIDA 3PK SPRINGF 9.99 R\n410 3 CUP BLK TEAPOT 9.99 R\n445 EMERIL GRIDDLE/PAN 17.99 R\n438 CANDYMAKER ASSORT 4.99 R\n474 TRIPOD 8.99 R\n433 BLK LOGO PRNTED ZO 7.99 R\n458 AQUA MICROTERRY SC 6.99 R\n493 30 L BLK FF DRESS 16.99 R\n407 LEVITATING DESKTOP 7.99 R\n441 ** Blue Overprint P 2.99 R\n476 REPOSE 4 PCPM CHOC 5.49 R\n461 WESTGATE BLACK 25 59.99 R\n------------------------------\nSUBTOTAL 160.38\nTAX 14.43\nTOTAL 174.81\nCASH 200.00\nCHANGE 25.19\n------------------------------\nPurchased item total number\nSign Up and Save!\nWith Preferred Saving Card\n"

Now Here I have a Plane HTML page like this

Search Images Maps Play YouTube News Gmail Drive More »
Web History | Settings | Sign in

                  Louisa May Alcott’s 184th birthday

       [                                                         ] Advanced
                                                                   searchLanguage
                   [Google Search][I'm Feeling Lucky]              tools

 Advertising ProgrammesBusiness Solutions+GoogleAbout GoogleGoogle.com

                       © 2016 - Privacy - Terms

I need to Print this from a url Can any one suggest me How to Print this plain text.. there is no HTML tags and no JSON data can any one suggest me how to print this plain text or How to add this plain text to a string..


Show source
| url   | android   | html   | printing   | plaintext   2016-11-30 10:11 0 Answers

Answers to How to Convert HTML to String android and print that string ( 0 )

Leave a reply to - How to Convert HTML to String android and print that string

◀ Go back