PdfFont: Keep font name

This commit is contained in:
2016-06-24 15:35:08 +02:00
parent 17001d6c8a
commit ed03166f6f
3 changed files with 8 additions and 2 deletions

View File

@@ -85,8 +85,9 @@ namespace VAR.PdfTools.Workbench
PdfTextExtractor extractor = new PdfTextExtractor(page);
foreach (PdfTextElement textElement in extractor.Elements)
{
lines.Add(string.Format("Text({0}, {1})({2}, {3}): \"{4}\"",
lines.Add(string.Format("Text({0}, {1})({2}, {3})[{4}]: \"{5}\"",
textElement.Matrix.Matrix[0, 2], textElement.Matrix.Matrix[1, 2], textElement.VisibleWidth, textElement.VisibleHeight,
textElement.Font == null ? string.Empty : textElement.Font.Name,
textElement.VisibleText));
}
}

View File

@@ -58,6 +58,7 @@ namespace VAR.PdfTools
foreach (KeyValuePair<string, IPdfElement> pair in fonts.Values)
{
var font = new PdfFont(pair.Value as PdfDictionary);
font.Name = pair.Key;
_fonts.Add(pair.Key, font);
}
}

View File

@@ -15,6 +15,8 @@ namespace VAR.PdfTools
private double _height = 1.0;
private string _name = string.Empty;
private bool _tainted = false;
#endregion
@@ -25,6 +27,8 @@ namespace VAR.PdfTools
public double Height { get { return _height; } }
public string Name { get { return _name; } set { _name = value; } }
public bool Tainted { get { return _tainted; } }
#endregion