Comments (6)
I've went through the source code a bit and found a possible solution.
An Implementation of $cmd -> isAvailableAs('LineBreak') and edit the height of the corresponding image, and add the required 8 bytes of null as needed.
Is this something that could work ?
I dont know how to edit .pbm images height tho.
from escpos-tools.
I think that escimages
is behaving correctly here, as the spacing is not part of the images. Ran the input through esc2html
, picture illustrates me selecting the whitespace in the browser, and this should be more true to the print-
There are a few approaches you could use here-
- OCR images separately
- add space when the images are stitched together (not sure how to do this with ImageMagick, but that would be the right place to do it)
Long term, we need a reliable way to convert receipt files to raster images. HTML has the most accurate output we get right now, so wkhtmltoimage
is a real option.
from escpos-tools.
I've found the solution, after your reply i googled a bit and found this topic https://superuser.com/a/290679 that suggest using +append instead of -append when using imagemagick's convert. I will try that soon and let you know.
from escpos-tools.
I've tried changing the -append to +append but results where not as expected.
I've also tried using wkhtmltoimage, but it doesn't run headless (what is a must for my needs).
Then i tried using xvfb but resulted in a low quality picture.
Also, if i'd OCR the images separately it becomes to slow for my purpose.
Any idea's ? :)
from escpos-tools.
This command is currently only going to to extract individual images, so I think you should initially add the whitespace back with ImageMagick. This documentation should hopefully get you started.
I think we could solve this properly in one of several ways:
- implement a flag in
escimages
(eg,--include-blank-lines
) to additionally output a 24px tall, 1px wide image for each line of text encountered. This is similar to what you are suggesting (low difficulty). - Implement a flag in
escimages
(eg--preserve-formatting
) to assemble the output into a single image for OCR users (medium difficulty). - Implement a totally separate command, eg
esc2image
, which renders entire receipts to images, just likeesc2html
(high difficulty).
Thoughts?
from escpos-tools.
I reckon any of those options would do the trick, first one seemingly the easiest, i would go for that.
from escpos-tools.
Related Issues (20)
- NC / Python binary forwarder | dumper HOT 1
- Error with some png image HOT 4
- Weird binary file, library wasn't able to give any output HOT 1
- Printing images HOT 2
- Add support for upside-down, black-white invert printing modes HOT 1
- Print Margin on Top HOT 2
- Support for QR codes HOT 5
- How to gerate Invoice like this? Or how to add html in print view? HOT 2
- esc2html encoding HOT 3
- I get a blank page when I execute my file ascii.bin with php esc2html.php ascii.bin > output.html HOT 2
- Add support for user-defined character sets HOT 1
- esc2html output error HOT 2
- fopen(/tmp/test.bin): failed to open stream: No such file or directory HOT 1
- esc2html: Uncaught ImagickException: insufficient image data in file
- Composer support HOT 1
- Add Docker support HOT 1
- Unable to generate Barcode HOT 1
- Unable to generate with Esc2html HOT 3
- Composer issue : Failed to extract mike42/escpos-php HOT 1
- For those who need encoding, use it. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from escpos-tools.