Implement code for DontResetIndentOnNewline for BGE
This commit is contained in:
parent
18e7dbcdad
commit
1b0079388e
@ -65,6 +65,12 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool _HasIndent = false;
|
||||
public bool HasIndent
|
||||
{
|
||||
get { return _HasIndent; }
|
||||
set { _HasIndent = value; }
|
||||
}
|
||||
private string _ImageText; // ro definition, value part of #Link in case of image/figure
|
||||
public string ImageText
|
||||
{
|
||||
@ -84,7 +90,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (_IParagraph == null)
|
||||
{
|
||||
_IParagraph = RtfToParagraph(Rtf);
|
||||
_IParagraph = RtfToParagraph(Rtf, HasIndent);
|
||||
}
|
||||
return _IParagraph;
|
||||
}
|
||||
@ -335,8 +341,20 @@ namespace Volian.Print.Library
|
||||
}
|
||||
public static iTextSharp.text.Paragraph RtfToParagraph(string rtf)
|
||||
{
|
||||
return RtfToParagraph(rtf, false);
|
||||
}
|
||||
public static iTextSharp.text.Paragraph RtfToParagraph(string rtf, bool hasIndent)
|
||||
{
|
||||
if (hasIndent)
|
||||
{
|
||||
hasIndent = rtf.Contains("\x05");
|
||||
if (hasIndent && rtf.Contains(@"\par \par")) rtf = rtf.Replace(@"\par \par", @"\par \u160? \par");
|
||||
if (hasIndent && rtf.Contains(@"\par\par")) rtf = rtf.Replace(@"\par\par", @"\par \u160? \par");
|
||||
}
|
||||
|
||||
IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf);
|
||||
Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc);
|
||||
rtf2IText.HasIndent = hasIndent;
|
||||
iTextSharp.text.Paragraph para = rtf2IText.Convert();
|
||||
para.SetLeading(_SixLinesPerInch, 0);
|
||||
if (rtf.Contains("\x05"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user