tauri
tauri copied to clipboard
[feat] Silent print API
Describe the problem
Window.print() alternative
Describe the solution you'd like
More printer options Margin and size no of copies
Alternatives considered
Window. Print()
Additional context
Native printer option margin and size select specific printer
What OS are you using?
Windows 10 os
I am not sure what you want exactly because the issue title says something but the body says another. Anyways window.print()
provides options to choose margins, number of copies, size...etc
Actually I don't want dialog for every time i print
This is a great idea. Most printing needs to be done silently
Hi, can I give this a try?
@Ian-Yy yeah sure, thanks!
Any solution?
Hi, sorry for taking so long. I was working on this in Linux at first but found out I can't cross build it to Windows and took more time setting the project up in Windows.
After checking things through, I found out that print
function is calling an API in the wry
lib which further just execute the following window.print()
as JS in Microsoft Edge WebView2 as shown here. Furthermore, I found that the Microsoft WebView2 is implementing a native way of printing as well here with silent print supported on experimental now.
So, I am not so sure too where to fix this. Perhaps, a PR is required on the wry
side to implement the experimental print function first?
I can't answer your question. But one thing to that part:
So, I am not so sure too where to fix this. Perhaps, a PR is required on the wry side to implement the experimental print function first?
We can't use experimental apis in wry. webview2-com doesn't support it and users would have to install non-stable webview2 runtimes (and manually set the runtime path). Edit: "non-stable runtime" means a non-stable (like canary) release of Edge afaik
But maybe @wravery has an idea here how we could fast-track this...
I think @FabianLars summed it up pretty well, it's best to wait for the API to be promoted to stable.
There is a small distinction between the WebView2 SDK and the runtime that's installed, they can be updated independently. Typically, the runtime self-updates, and as long as it's new enough it'll support all of the features in the pre-release SDK. If you don't mind using experimental status APIs, you can usually just update the SDK to unlock them earlier.
In this case, that would mean updating the webview2-com crate and wry, but probably hanging back on the windows-rs versions because of the MSRV requirements in the latest version of those crates. The dependencies would get pretty complicated if we wanted to update just the WebView2 SDK version and expose the experimental APIs.
closing in favor of #4917
I am looking forward to the silent printing API, because my app needs this API to print small tickets and price tags
@ihekui , @ibalaji777 Have anyone found the solution for this?
I found that the Microsoft WebView2 is implementing a native way of printing as well https://github.com/MicrosoftEdge/WebView2Feedback/issues/1331 with silent print supported on experimental now.
Well, this is now stable
I'm creating an order management system, but until everything stabilizes... I'll continue using electron.
Hi Guys, hope you doing well, any update on this?
Actually I badly need this , but seems there is no solution till now 😞...
Can we use this Rust libs with js ?
-
https://crates.io/crates/escpos
-
https://crates.io/crates/recibo
I Dont much knowledge in RUST