我用的是iTextSharp,用它生成的PDF格式,无法控制标点符号出现在有些行的行首,这不符合语法规则,大家谁有解决的好办法?试过设置分隔符,但是对中文标点符号不怎么起作用public bool IsSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)
{
char c;
if (ck == null)
c = cc[current];
else
c = (char)ck[Math.Min(current, ck.Length - 1)].GetUnicodeEquivalent(cc[current]);
if (c=='。')
return true; if (c < 0x2e80)
return false;
return ((c >= 0x2e80 && c < 0xd7a0)
|| (c >= 0xf900 && c < 0xfb00)
|| (c >= 0xfe30 && c < 0xfe50)
|| (c >= 0xff61 && c < 0xffa0));
}
{
char c;
if (ck == null)
c = cc[current];
else
c = (char)ck[Math.Min(current, ck.Length - 1)].GetUnicodeEquivalent(cc[current]);
if (c=='。')
return true; if (c < 0x2e80)
return false;
return ((c >= 0x2e80 && c < 0xd7a0)
|| (c >= 0xf900 && c < 0xfb00)
|| (c >= 0xfe30 && c < 0xfe50)
|| (c >= 0xff61 && c < 0xffa0));
}
public bool IsSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)
{
char c;
if (ck == null)
c = cc[current];
else
c = (char)ck[Math.Min(current, ck.Length - 1)].GetUnicodeEquivalent(cc[current]);
if (c <= ' ' || c == '-')
{
return true;
}
if (c < 0x2e80)
return false;
return ((c >= 0x2e80 && c < 0xd7a0)
|| (c >= 0xf900 && c < 0xfb00)
|| (c >= 0xfe30 && c < 0xfe50)
|| (c >= 0xff61 && c < 0xffa0))
&& (current >= cc.Length - 1 || ",。;、:!?".IndexOf(cc[current + 1]) == -1);
}