In order for the user to view the source correctly, the source must be on his computer, not on the server.
If you are going to serve a PDF as a page element, the only cohesive solution is to generate the corresponding image.
With the source on the server, you can generate the image with the graphical framework libraries, i.e.:
string nomeDaSuaFonte = "eu não sei o nome de família dela, mas você pode descobrir. Substituia por este texto.";
var fontFamily = new FontFamily(nomeDaSuaFonte);
var font = new Font(fontFamily, 32, FontStyle.Regular, GraphicsUnit.Pixel);
var solidBrush = new SolidBrush(Color.Black);
var bitmap = new Bitmap(largura, altura); // Monte conforme suas necessidades
var graphics = Graphics.FromImage(bitmap);
graphics.DrawString("seu código de barras aqui", font, solidBrush, new PointF(10, 60));
You can also generate a PDF on the server. There are several libraries for this. If you are using MVC, I suggest using Rotating. You still need to generate the barcode as an image, as above, but at least you ensure that the user has access to a PDF with the correctly rendered barcode.
The suggestion would be not to use font to generate bars. Despite the convenience, barcode are so simple that it costs nothing to draw straight by the application (in particular the C128). If you’re really going to insist on the source and you don’t want any trouble, you need to do the embed of it in the PDF, not just make it available on the machine. But make sure that bar font embed is always a second-rate solution, to say the least.
– Bacco
Genexus has a configuration file that takes care of embedding the source by generating the pdf as commented below.
– Rubem Deiana