I make android app which will send PCL commands to BT printer (HP Officejet 100). Problem is when I send string data(PCL command) printer don't recognized these commands and print all these commands like normal strings. Any idea why printer don't recognize commands? My full code here: CODE
I also try change charset to US-ASCII, UTF-8 but PCL command was not recognized.
Second question: is there any way how I can convert PDF file to PCL or how I can do way when I need print PDF files on this printer?
Now I can print strings but I cannot print pdf or images etc and I find way how do this. THX for any help.
Part of code:
void sendCustomData() throws IOException {
try {
String msg =
"<ESC>%-12345X@PJL COMMENT *Start Job* <CR><LF>\n" +
"@PJL JOB NAME = \"Sample Job #1\" <CR><LF>\n" +
"@PJL SET COPIES = 1 <CR><LF>\n" +
"@PJL SET RET = OFF <CR><LF>\n" +
"@PJL ENTER LANGUAGE = PCL <CR><LF>\n" +
"<ESC>E. . . . PCL job . . . .<ESC>E\n" +
"~<ESC>%-12345X@PJL <CR><LF>\n" +
"@PJL EOJ<CR><LF>\n" +
"<ESC>%-12345X";
mOutputStream.write(msg.getBytes("ASCII"));
tvStatus.setText("Custom data sent");
} catch (NullPointerException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeBT();
Toast.makeText(this, "BT conn closed", Toast.LENGTH_SHORT).show();
}
}