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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user