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 a html print template):
{
"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 string\n");**//this is sample text**
textData.append(Html.fromHtml(status + "\n"));
**//this is JSON response which is nothing but HTML code, so I am converting it to string**
Over there I have used status
as a string so that whatever the content is inside that string, it is printed.
If it's is not a html but just a plain text I will print it like this
method = "addFeedLine";
mPrinter.addFeedLine(1);
textData.append(status);
Here is an example of what status
looks like
"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 plain HTML page:
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 an url.
Can anyone suggest me how to print this plain text? There is no HTML tags and no JSON data.