I want to generate Ean18 to SVG like this:

As you see, the code has a lead, separator and trailer.
This question is similar like https://github.com/micjahn/ZXing.Net/discussions/452
However, the solution above using some package only works in Windows and currently I need to run in Linux/MAC/Android/IOS for cross platform.
In addition, that way seems cannot generate to SVG format also.
How can I solve this?