Source rendering error Code128

0

I developed a report on Genexus X Ev1 that needs to print the barcode using the Code128 font. It is compiled in .NET .

In the development environment ( Windows 2012 ) everything works perfectly. The problem is on the production server ( Windows 2008 ). In PDF printing in place of the image appear numbers.

I tried to reinstall the source on the production server and apparently this is ok. But printing / rendering of pdf in any browser is wrong.

Any suggestions on other settings that I should check?

    
asked by anonymous 24.04.2017 / 16:02

2 answers

0

In order for the user to view the font correctly, the font must be on his computer, not 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 libraries of the framework, 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're using MVC, I suggest using Rotating . You still need to generate the barcode as an image as above, but at least you guarantee that the user has access to a PDF with the barcode rendered correctly.

    
24.04.2017 / 16:36
0

Rubem,

Compare the PDFReport.ini file versions of the development server, with the production server, specifically in the [EmbeedFonts] section.

More information: link ,

link ;;

In this file there is also a barcode generation tag for the image: Barcode128AsImage. It would have to see if in X Ev. 1 works, as I have not found any Gx version references.

    
24.04.2017 / 22:22