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

raster example command #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mcluseau
Copy link
Collaborator

Hi,

Warning: this pulls your wip-rewrite branch.

raster command example. About features, here's the usage ;-) :

Usage of image2pos:
  -a string
    	Alignment (left, center, right) (default "center")
  -c	Cut after print
  -i string
    	Input image (default "image.png")
  -p string
    	Printer dev file (default "/dev/usb/lp0")
  -printer-max-width int
    	Printer max width in pixels (default 512)
  -t float
    	Black/white threshold (default 0.5)

@kenshaw
Copy link
Owner

kenshaw commented Feb 26, 2018

This looks good. Have you actually tried to print that image? If so, would it be possible to add a quick photo of the output? I'll update the documentation, etc. and point to those. Really appreciate your efforts here!

@mcluseau
Copy link
Collaborator Author

Here you are ;-)

@MeritEhab
Copy link

Why this branch is not merged ?!

@mcluseau
Copy link
Collaborator Author

mcluseau commented May 8, 2018

We have conflicts to resolve here, but the example on the current code base is merged:

https://github.com/kenshaw/escpos/blob/master/example/image2pos/main.go

@MeritEhab
Copy link

@mcluseau did you consider printers which support only bitmap ?!

@MeritEhab
Copy link

@mcluseau hello again, your raster code is very code it works pretty fine on my Epson TM88
but when I switched to SPRT SP-POS88VMF the image is printed as weird charters I searched for that and I found out that the SPRT printer don't support graphics, it supports bitImage or bitmap and bitcloumn rastrazation

Back to you code I found in the comments beside the code in the raster.go file line 21 to be specif

0x1d, 0x38, 0x4c, // GS 8 L, Store the graphics data in the print buffer -- (raster format), p. 252

so I was wondering dose the GS 8 L command concerned with the graphics only, and could i find
another command to support the bitmap storing data or I am digging at the wrong place and this is not the code snippet that should be changed

Sorry for the long comment and I would really appreciate your help
Thanks in Advance

@mcluseau
Copy link
Collaborator Author

mcluseau commented Jul 17, 2018

Hi Merit, I only tried to implement support my specific use case, as you seem to try to do. I think other printer models will need other formats and you need to find the specification and add you conversion code from golang images to bitmap in a sub-package. So, just like there is raster, you'd have bitmap. And if your printer has a completely different protocol, of course this project is not the right target ou will need a major refactoring if we intend to handle lots of printers ;)

@MeritEhab
Copy link

@mcluseau hi thanks for your reply
And it's okay I have refactored the project and wrote a method for supporting bitmap images already

Thanks

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

Successfully merging this pull request may close these issues.

3 participants