PdfFont: Keep font name
This commit is contained in:
@@ -85,8 +85,9 @@ namespace VAR.PdfTools.Workbench
|
|||||||
PdfTextExtractor extractor = new PdfTextExtractor(page);
|
PdfTextExtractor extractor = new PdfTextExtractor(page);
|
||||||
foreach (PdfTextElement textElement in extractor.Elements)
|
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.Matrix.Matrix[0, 2], textElement.Matrix.Matrix[1, 2], textElement.VisibleWidth, textElement.VisibleHeight,
|
||||||
|
textElement.Font == null ? string.Empty : textElement.Font.Name,
|
||||||
textElement.VisibleText));
|
textElement.VisibleText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ namespace VAR.PdfTools
|
|||||||
foreach (KeyValuePair<string, IPdfElement> pair in fonts.Values)
|
foreach (KeyValuePair<string, IPdfElement> pair in fonts.Values)
|
||||||
{
|
{
|
||||||
var font = new PdfFont(pair.Value as PdfDictionary);
|
var font = new PdfFont(pair.Value as PdfDictionary);
|
||||||
|
font.Name = pair.Key;
|
||||||
_fonts.Add(pair.Key, font);
|
_fonts.Add(pair.Key, font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ namespace VAR.PdfTools
|
|||||||
|
|
||||||
private double _height = 1.0;
|
private double _height = 1.0;
|
||||||
|
|
||||||
|
private string _name = string.Empty;
|
||||||
|
|
||||||
private bool _tainted = false;
|
private bool _tainted = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -25,6 +27,8 @@ namespace VAR.PdfTools
|
|||||||
|
|
||||||
public double Height { get { return _height; } }
|
public double Height { get { return _height; } }
|
||||||
|
|
||||||
|
public string Name { get { return _name; } set { _name = value; } }
|
||||||
|
|
||||||
public bool Tainted { get { return _tainted; } }
|
public bool Tainted { get { return _tainted; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user