diff --git a/VAR.PdfTools/PdfFont.cs b/VAR.PdfTools/PdfFont.cs index cf2ba8a..91c7e26 100644 --- a/VAR.PdfTools/PdfFont.cs +++ b/VAR.PdfTools/PdfFont.cs @@ -87,14 +87,16 @@ namespace VAR.PdfTools char actualChar = firstChar; foreach (IPdfElement elem in widths.Values) { - if (elem is PdfReal widthReal) + var widthReal = elem as PdfReal; + if (widthReal != null) { double charWidth = widthReal.Value / glyphSpaceToTextSpace; _widths.Add(actualChar, charWidth); actualChar++; continue; } - if (elem is PdfInteger widthInt) + var widthInt = elem as PdfInteger; + if (widthInt != null) { double charWidth = widthInt.Value / glyphSpaceToTextSpace; _widths.Add(actualChar, charWidth);