15,891,184 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 4773987 (Top 4 by date)
Member 4773987
25-May-20 11:51am
View
I checked all details, everything is fine, the tablet which connect to printer does not return any error and does not print
Member 4773987
23-May-20 17:31pm
View
The below code build without any errors, also i did all configuration successful,
While run the application in mobile does not connect to printer it is return erros, fine.
But when i run it in the connected Tablet with the same network with Epson Tm-M30 printer it is not print and no error appear. Please i need help why it is not print?
enter code here
final Context sContext = this;
Printer printer = null;
try {
printer = new Printer(Printer.TM_M30, Printer.MODEL_ANK, this);
}
catch (Epos2Exception e) {
//Displays error messages
Toast.makeText(sContext, "Error1", Toast.LENGTH_SHORT).show();
}
//new
final Context mContext = this;
printer.setReceiveEventListener(new ReceiveListener() {
@Override
public void onPtrReceive(Printer printer, int code, PrinterStatusInfo printerStatusInfo,
String s) {
if (code == com.epson.epos2.Epos2CallbackCode.CODE_SUCCESS){
}else{
Toast.makeText(mContext, "Printer can't be connected. Please try again",
Toast.LENGTH_SHORT).show();
}
}
});
try {
printer.addTextAlign(Printer.ALIGN_CENTER);
printer.addText("Hello World");
}
catch (Epos2Exception e) {
Toast.makeText(mContext, "Can't print Hello World. Please try again",
Toast.LENGTH_SHORT).show();
}
try {
printer.connect("TCP:192.168.100.21", Printer.PARAM_DEFAULT);
}
catch (Epos2Exception e) {
Toast.makeText(mContext, "Error1", Toast.LENGTH_SHORT).show();
}
try {
printer.sendData(Printer.PARAM_DEFAULT);
}
catch (Epos2Exception e) {
Toast.makeText(mContext, "Error2", Toast.LENGTH_SHORT).show();
// Abort process
}
//public void onPtrReceive(final Printer printerObj, final int code, final PrinterStatusInfo
status,
//final String printJobId) {
ReceiveListener printrecieve_listener = new ReceiveListener() {
@Override
public void onPtrReceive(final Printer printerObj, final int code, PrinterStatusInfo
printerStatusInfo, String printJobId) {
runOnUiThread(new Runnable() {
@Override
public synchronized void run() {
if (code == com.epson.epos2.Epos2CallbackCode.CODE_SUCCESS) {
} else {
Toast.makeText(mContext, "Error3", Toast.LENGTH_SHORT).show();
}
}
});
new Thread(new Runnable() {
@Override
public synchronized void run() {
}
}).start();
Member 4773987
20-May-20 10:30am
View
I need to print pdf file direct to printer, i don’t know how?
Member 4773987
24-Feb-20 14:52pm
View
Sorry, confused