Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print html directly #11

Open
deysudip opened this issue Apr 20, 2018 · 5 comments
Open

Print html directly #11

deysudip opened this issue Apr 20, 2018 · 5 comments
Labels

Comments

@deysudip
Copy link

deysudip commented Apr 20, 2018

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?

@Blair2004
Copy link
Contributor

Hi,
Well the project support XML which is converted into a ESC/POS commands. The XML language is (i think) enough to have a good receipt. The support for HTML is not yet included.

@ingoncalves
Copy link
Owner

Like @Blair2004 said, the purpose of this project is to write ESC/POS instructions in XML language. I'll explain.

First of all, there are many thermal-printers that support standardized instructions. This standard is a protocol, named as ESC/POS. However, these instructions are a sequence of bits that follow some structure and to write a plain text may be a hard work. Hence, to write these instructions with XML tags may be easier than bit buffers. Thus, this library translates XML tags into ESC/POS commands (bit buffers). Because of that, to convert stylized HTML divs isn't the same thing that this library does.

Answering your last question, the result of that translation XML to ESC/POS is a bit buffer. This information must be sent to the printer, through some kind of stream (eg: Bluetooth, USB, etc).

Got it?

@FazilMuhammed
Copy link

@Blair2004 some characters like & , < , > ' , " I cannot get properly to print what is the reason please help?

@Blair2004
Copy link
Contributor

Probably you need to have them encoded into HTML entities... adding a < within the xml tags make that invalid.

@FazilMuhammed
Copy link

@Blair2004 give any example to encoded in to HTML entities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants