@alizadefaig/pos-server 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -111,12 +111,14 @@ router.get('/printers.get', async (req, res) => {
|
|
|
111
111
|
router.post('/printers.print', async (req, res) => {
|
|
112
112
|
const device = getPrinterDevice(req.body.printer);
|
|
113
113
|
const printMethod = req.body.print_method || 'raster';
|
|
114
|
-
const printMode = req.body.
|
|
114
|
+
const printMode = req.body.mode;
|
|
115
|
+
const partHeight = req.body.height || 576;
|
|
116
|
+
const partWidth = req.body.width || 576;
|
|
115
117
|
if (!device) {
|
|
116
118
|
return res.send('bad').status(404);
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
const contentsBuffer = await splitImageByHeight(req.body.content,
|
|
121
|
+
const contentsBuffer = await splitImageByHeight(req.body.content, partHeight, partWidth);
|
|
120
122
|
const images = await new Promise(async (resolve, reject) => {
|
|
121
123
|
let _images = [];
|
|
122
124
|
for (const buffer of contentsBuffer) {
|
|
@@ -148,6 +150,7 @@ router.post('/printers.print', async (req, res) => {
|
|
|
148
150
|
return;
|
|
149
151
|
}
|
|
150
152
|
|
|
153
|
+
printer.align('CT');
|
|
151
154
|
images.map(image => {
|
|
152
155
|
if (printMethod === 'raster') {
|
|
153
156
|
printer.raster(image, printMode);
|