anastaciocintra / escpos-coffee

Java library for ESC/POS printer
https://anastaciocintra.github.io/escpos-coffee
MIT License
280 stars 74 forks source link

how to auto-render the height with a fixed width for any HTML document to capture them to an image? #66

Open VISHNUVIKAS007 opened 3 years ago

VISHNUVIKAS007 commented 3 years ago

I am trying to convert an HTML file to an image in my application for printing purposes. All standard libraries that I have tried to generate images from HTML (For example, JavaFX Webview) expect both height and width as input parameters. We have HTML contents with varying heights. So we cannot predict the height beforehand. Only the library FlyingSaucer needs width as a parameter while being able to render the height automatically based on content, but the library has an LGPL license and is therefore hard to mix with our proprietary code. It would be really helpful if you could share some insights into how to auto-render the height with a fixed width for any HTML document to capture them to an image.

anastaciocintra commented 3 years ago

hi @VISHNUVIKAS007,

about height Yes my friend, in my research, I've found only flyingSauer that can run on server (without GUI). Webview is good but, in my tests, it worked only with a Scene (GUI environment) with heght and width...

I didn't test paid products.

about LGPL:

I'm not a lawyer, and I don't know exactly whats your projects guidelines about licenses, but LGPL libraries can be used without problems on commercial product, you need only to use it as a lib (jar) in classpath. see https://www.quora.com/Is-LGPL-free-for-commercial-use

IMHO Its better you to ask directly on https://github.com/flyingsaucerproject/flyingsaucer