468,167 Members | 1,856 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

Print PDF from android using epson sdk

I have install Epson SDK to android, and added the below code"

Printer printer = null;
try {
printer = new Printer(Printer.TM_M30, Printer.MODEL_ANK, this);
}
catch (Epos2Exception e) {
//Displays error messages
}

//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();
}
}
});
how to print direct to Epson PDF
May 20 '20 #1
3 3173
dev7060
413 Expert 256MB
What is the error? What exactly is not working?
May 20 '20 #2
i want to put pdf path to print, i don't know exact code
May 20 '20 #3
Ishan Shah
47 32bit
import com.epson.eposprint.*;

public class EPOSPrintSampleActivity extends Activity implements OnClickListener, StatusChangeEventListener,
{

static Print printer = null;
String openDeviceName = "192.168.192.168";
int connectionType = Print.DEVTYPE_TCP;
int language = com.epson.eposprint.Builder.LANG_EN;
String printerName = "TM-T88V";

static void setPrinter(Print obj){
printer = obj;
}

static Print getPrinter(){
return printer;
}

static void closePrinter(){
try{
printer.closePrinter();
printer = null;
}catch(Exception e){
printer = null;
}
}
Mar 11 '21 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Joshua Burvill | last post: by
6 posts views Thread by Kebmo | last post: by
1 post views Thread by milti | last post: by
1 post views Thread by Mike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.