empira / PDFsharp-1.5

A .NET library for processing PDF
MIT License
1.28k stars 588 forks source link

Rendering Code39 or ITF bar code with embedded text exception is thrown #108

Open MikeGratsas opened 4 years ago

MikeGratsas commented 4 years ago

When Code39 or Interleaved 2 of 5 bar code is rendered using PDFSharp library and TextLocation.AboveEmbedded or TextLocation.BelowEmbedded is selected for this bar code if font size used to draw text is so large that graphics MeasureString method returns height greater than bar code height exception is thrown in ThickThinBarcodeRenderer.RenderBar method info.Gfx.DrawRectangle(info.Brush, rect); statement since value of rect.Height is negative.