Convert number to barcode Code 128

The reason it will show on your local machine is because you have the code128 font installed so its accessible to the web browser for use
In the web app, which would normally run on a server, the font would need to be installed there. Then if you draw the result into a picture and then embed that picture in a web page you should see the bar code in what ever web browser is used since its just an image.

The desktop app with an HTMLViewer will vary depending on which desktop OS your running (macOS, Windows, Linux)
On Windows you could be using either the native web browser control, which can vary widely in what version of IE/Edge its based on, or WebKit. And this can lead to very different behaviour.

I’d focus on writing the web app and getting that to display the barcode in Chrome or whatever browser you normally use and not worry about creating the desktop app to test things UNLESS the desktop app is crucial to the software you’re writing