Convert Hard hyphens to soft hyphens so that the PDF can be searched for hyphens.

Use the ISplitCharacter Interface to treat soft hyphens as non-breaking hyphens (only word wrap on spaces)
This commit is contained in:
Rich
2015-02-09 16:07:12 +00:00
parent 93043d7fd4
commit ad300e777a
4 changed files with 109 additions and 3 deletions

View File

@@ -682,11 +682,17 @@ namespace Volian.Svg.Library
ColumnText ct = new ColumnText(cb);
float x = (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") ? scale.AbsX(X): scale.X(X);
float w = 0; // chk.GetWidthPoint();
// Change the chunks to only split on spaces rather than spaces and hyphens
foreach (Chunk chk in ph.Chunks)
{
w += chk.GetWidthPoint();
// Change the chunks to only split on spaces rather than spaces and hyphens
chk.SetSplitCharacter(mySplitter);
if (chk.Attributes == null || !chk.Attributes.ContainsKey("NoSplit"))
{
if (chk.Attributes == null) chk.Attributes = new Hashtable();
chk.SetSplitCharacter(mySplitter);
chk.Attributes.Add("NoSplit", false);
}
}
switch (Justify)
{