Open daniellizik opened 5 years ago
Testing printing just a really long black line from safari technology preview console
(() => {
const n = 550000;
const arr = [
98,
n,
0,
...(new Array(n).fill(255))
];
window.starprnt.print(
'BT:TSP100',
'StarGraphic',
[{ appendRawBytes: arr }],
(e) => alert(JSON.stringify(e)),
(e) => alert(JSON.stringify(e))
);
})();
this crashes iOS, but around n = 525000
seems to be the limit but at that size it takes maybe 10 seconds for my TSP100iiiBI to receive the data
Experimenting with setting the raster page length
(() => {
const n = 525000;
const arr = [
27, 42, 114, 80, 0, 0,
98,
n,
0,
...(new Array(n).fill(200))
];
window.starprnt.print(
'BT:TSP100',
'StarGraphic',
[{ appendRawBytes: arr }],
(e) => alert(JSON.stringify(e)),
(e) => alert(JSON.stringify(e))
);
})();
This doesn't seem to do anything different, neither does setting raster page length to 64000
Hi @daniellizik,
Is it possible to share the complete code, i also generate receipt with Imagick without success. If I can reproduce maybe I can help you.
Hi @daniellizik,
Is it possible to share the complete code, i also generate receipt with Imagick without success. If I can reproduce maybe I can help you.
I never figured it out. Seems to be an issue in iOS, not this lib. Anyway, I am just chunking the payload which works fine but is a a bit slower (especially on bluetooth) since each payload needs to be transmitted sequentially.
Hi @daniellizik, Is it possible to share the complete code, i also generate receipt with Imagick without success. If I can reproduce maybe I can help you.
I never figured it out. Seems to be an issue in iOS, not this lib. Anyway, I am just chunking the payload which works fine but is a a bit slower (especially on bluetooth) since each payload needs to be transmitted sequentially.
Thanks for you response. Personally I still have some problems with the structure of the data which is sent in the appendRawBytes parameter, if you have a complete example I would be the happiest of men.
I'm trying to send a large byte array to
.print
with theappendRawBytes
print command (it's a decoded base64 string). The size of the array is1335297
bytes (~1335.3
kB). On smaller arrays the TSP100iiiBI prints fine, but for larger arrays my app crashes and I get an error report on crashlytics:Anyone else seen this problem? Here's the byte array I'm sending.
I could probably solve this by breaking up the raster into chunks and printing those, then on the final chunk cutting the paper but if there's some configuration I'm missing that'd be great.