Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send raw data? #13

Open
olekhov opened this issue Dec 20, 2021 · 1 comment
Open

How to send raw data? #13

olekhov opened this issue Dec 20, 2021 · 1 comment

Comments

@olekhov
Copy link

olekhov commented Dec 20, 2021

Hello, I need to send raw data to printer.
I am using thermal transfer Zebra printer to print stickers.
Each sticker is encoded, like this:

.

N
q300
Q200,24
S1 ; speed
D2 ; density
A10,20,0,3,1,1,N,"-----------------"
A10,40,0,3,1,1,N,""
A10,60,0,3,1,1,N,"TEST 172.30.40.64"
A10,80,0,3,1,1,N,""
A10,120,0,3,1,1,N,"----------------"
P1
.

Problem is, this data is sent to printer as text, whereis it should be sent as raw.
As result, stickers look like this:
image

These are commands for EPL language, described here

I can print as raw with command like this:

$ cat label.txt | lpr -PZebra_Technologies_ZTC_GK420t -oraw
@ARogovskyy
Copy link
Contributor

Have you tried specifying the document-type to something like application/octet-stream? That should instruct the printer to interpret the data as raw / detect the format itself. Something like this should make it work:

let mut builder = IppOperationBuilder::print_job(uri, payload)
        .attribute(IppAttribute::new("document-format", IppValue::MimeMediaType(String::from("application/octet-stream"))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants