ingoncalves / escpos-xml Goto Github PK
View Code? Open in Web Editor NEWJavaScript library that implements the thermal printer ESC / POS protocol and provides an XML interface for preparing templates for printing.
License: Apache License 2.0
JavaScript library that implements the thermal printer ESC / POS protocol and provides an XML interface for preparing templates for printing.
License: Apache License 2.0
Hello,
It seems to an interesting project but I can’t figure out how to make it work for a simple template.
Would you add an example of use in the repo ?
Thanks a lot !
getting these errors:
ERROR in node_modules/escpos-xml/lib/buffer-builder.ts(9,19): error TS2554: Expected 2 arguments, but got 0.
node_modules/escpos-xml/lib/buffer-builder.ts(150,5): error TS2322: Type 'Buffer' is not assignable to type 'number[]'.
Property 'push' is missing in type 'Buffer'.
I have fixed it by changing the return to return Array.prototype.slice.call(this.buffer.flush(), 0);
in buffer-builder.ts
line 150
there are some important fixes on branch master, can you please release a new version? thanks
Unfortunately, the project doesn't have implemented tests yet. It's crazy but it's the truth.
The documentation should be improved with a complete API section and more examples.
Hello! Thanks for this great project.
I need to use characters like "ç", "é", etc... When I print with that, I get something like "chinese" characters.
Is it possible with this lib? Or is this a limitation of my printer(I'm testing in a "Kinup KP-1019")?
Obs: I'm new with this.
Thank you!
anyone please help me how to print a image using this library.
@ingoncalves Did you made template for the table printing?
Thank you.
I have a project where I need to build a web portal to print different labels and invoices. I have created a nice HTML div with styles and all which I am currently using for printing. But I need a kind of direct approach, and currently, it is going through the printing dialog where the user has to click on the print button to print the labels. I am thinking that your library can help me to bypass that. So thinking that, can I use my already existing div as input to your buffer? It is not exactly an issue, but kind of a suggestion or a question providing that I am missing something in the documentation.
And also please help me with the last part of your every example. You have mentioned sending the data to a stream like Bluetooth. Could you please tell me how I can do that?
I'm interested in this library. Is this library still maintained by someone?
Or do we have any fork that is in a good (not strictly) state?
Not able to get QR Code using this.
I'm trying to print some text with padding on both sides but the text is trimmed. I've tried putting xml:spaces="preserve"
but also not supported. Any suggestion what can I do to format text something like:
<text-line xml:space="preserve">(5 spaces)Medium</text-line>
Hello!
I'm trying to print in the same line but with different alignments, doing like this:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<line-feed />
<align mode="left">
<bold>
<text size="2:1">TEXT ON LEFT</text>
</bold>
</align>
<align mode="right">
<bold>
<text size="1:0">TEXT ON RIGHT</text>
</bold>
</align>
</document>
If I do this using <text-line>
instead of <text>
it works, but, obviously, the printer jumps one line.
Is it possible?
Thanks in advance.
I am getting above error on loading page
`//
// This is the client side entry point for the React app.
//
import React from "react";
import { render } from "react-dom";
import { routes } from "./routes";
import { Router, browserHistory } from "react-router";
import { createStore, applyMiddleware } from "redux";
//import { createStore } from "redux";
import { Provider } from "react-redux";
import { createLogger } from "redux-logger";
import { notify } from "react-notify-toast";
import "./styles/base.css";
import rootReducer from "./reducers";
import { showSpinner } from "./actions";
import { sessionService } from "redux-react-session";
import thunk from "redux-thunk";
import * as sessionApi from "./api/sessionapi";
require.ensure(["./sw-registration"], (require) => {
require("./sw-registration")(notify);
}, "sw-registration");
/**/
const validateSession = (session) => {
// check if your session is still valid
return true;
}
const renderApp = (store) => {
const showSpinnerOnLoad = () => {
store.dispatch(showSpinner());
};
render(
{routes(showSpinnerOnLoad)}
,
document.querySelector(".js-content")
);
};
window.webappStart = () => {
const initialState = window.PRELOADED_STATE;
const middleware = applyMiddleware(thunk, createLogger());
const store = createStore(rootReducer, initialState, middleware);
//const store = createStore(rootReducer, initialState);
sessionService.initSessionService(store,
{ refreshOnCheckAuth: true, redirectPath: "/login", driver: "COOKIES",validateSession });
sessionApi.login().then(response => {
const { token } = response;
if (token === 0) {
renderApp(store);
} else {
sessionService.saveSession({ token })
.then(() => {
sessionService.saveUser(response.data);
renderApp(store);
}).catch(err => err);
}
});
};
`
//package.json
{
"name": "ivdashboard",
"version": "0.0.1",
"description": "IVCargo Dashoboard ",
"homepage": "",
"author": {
"name": "Mitesh",
"email": "[email protected]",
"url": ""
},
"contributors": [
"Mitesh"
],
"files": [
"server",
"client",
"test"
],
"main": "server/index.js",
"keywords": [
"Dashoboard",
"Ivcargo"
],
"repository": {
"type": "git",
"url": "miteshivgroup/ivdashboard"
},
"license": "ISC",
"engines": {
"node": "^4.x.x || ^6.x.x || ^7.x.x",
"npm": ">= 3.x.x"
},
"scripts": {
"prestart": "gulp build",
"start": "if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi",
"test": "gulp check",
"coverage": "gulp check",
"prod": "echo 'Starting standalone server in PROD mode' & SET NODE_ENV=production & node ./lib/server/",
"heroku-postbuild": "gulp build"
},
"dependencies": {
"@ag-grid-community/all-modules": "^22.0.0",
"@ag-grid-community/react": "^22.0.0",
"@material-ui/core": "^3.9.2",
"babel-plugin-transform-node-env-inline": "^0.1.1",
"bluebird": "^3.5.0",
"boom": "^5.2.0",
"chart.js": "^2.6.0",
"core-js": "^3.4.7",
"electrode-archetype-react-app": "^3.1.6",
"electrode-confippet": "^1.5.0",
"electrode-csrf-jwt": "^1.2.1",
"electrode-react-ssr-caching": "^0.1.6",
"electrode-react-webapp": "^1.7.2",
"electrode-redux-router-engine": "^1.4.5",
"electrode-server": "^1.2.2",
"electrode-static-paths": "^1.1.0",
"events": "^1.1.1",
"get-parameter": "^1.0.8",
"lodash": "^4.17.4",
"material-ui": "^0.18.6",
"moment": "^2.24.0",
"query-string": "^4.3.4",
"react": "^15.6.2",
"react-chartjs-2": "^2.5.3",
"react-dom": "^15.6.2",
"react-flexboxgrid": "^1.0.1",
"react-html-table-to-excel": "^2.0.0",
"react-notify-toast": "^0.3.0",
"react-select": "^2.4.4",
"react-tap-event-plugin": "^3.0.3",
"redux-logger": "^3.0.6",
"redux-react-session": "^2.6.0",
"redux-thunk": "^2.2.0",
"require-at": "^1.0.0",
"wreck": "^12.2.2",
"xclap": "^0.2.39",
"xsh": "^0.3.7"
},
"devDependencies": {
"electrode-archetype-react-app-dev": "^3.1.6",
"gulp": "^3.9.1"
}
}
Hi, your project is really valuable for me. I'm currently using that for : https://codecanyon.net/item/nexo-print-server/21867974
But the most important part now is providing a support for image. Have you yet started to investigate on this ? Any link that i can use to work on that ?
Thank you.
I want to use loop in template format.
Can anyone please tell me how it will achieve.
Thanks #
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.