Comments (4)
Are you able to share the contents of temp_print.bin
either on this issue tracker or via the email address on my profile?
I can't see a way to debug this without a sample file which shows the issue.
from escpos-tools.
Hi Mike,
I already send to your email
from escpos-tools.
Received.
Your file is malformed: You are using the GS ( L
command, which only allows you to specify a data length up to 65kb. Your image is around 80kb in the ESC/POS 1-bit raster format, so you should be using GS 8 L
, which allows for larger data sizes
The file contains 1d 28 4c 4a 37
(GS ( L
data header for 14154
bytes of data), while the actual image command contains 764x830 dimensions. If necessary, we can detect the number of bytes from the dimensions, and ignore the data header entirely.
So with this small patch, your file will process:
diff --git a/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php b/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php
index dcf9e47..41d4ced 100644
--- a/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php
+++ b/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php
@@ -51,6 +51,7 @@ class StoreRasterFmtDataToPrintBufferGraphicsSubCmd extends DataSubCmd implement
return true;
} else if ($this -> y2 === null) {
$this -> y2 = ord($char);
+ $this -> dataSize = intdiv($this -> getWidth() + 7, 8) * $this -> getHeight();
return true;
} else if (strlen($this -> data) < $this -> dataSize) {
$this -> data .= $char;
I have not tried to print your file, but if it works on an Epson printer, I would consider applying this patch in some form, otherwise we should return only part of the image.
In either case, we can detect the problem and log a warning when this situation arises.
from escpos-tools.
Thanks! its working to process to html, I don't have Epson printer, but I think my client using an Epson printer, so if it's working I will tell you.
Thank you
from escpos-tools.
Related Issues (20)
- 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
- How to implement in laravel? HOT 1
- PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given HOT 1
- Encoded characters in decoded output
- there is no bigger BULLSHIT than your programm HOT 1
- Is PHP 8.2 Supported? I get this error after upgrading - Uncaught Error: Undefined constant "ReceiptPrintHq\EscposTools\Parser\Command\STDERR
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.