SaveRTF extra spaces

Last post 04-24-2011, 9:10 PM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  04-20-2011, 12:20 PM 67267

    SaveRTF extra spaces

    I am having to load my saved rtf file up and apply the following changes in order to remove extra unwanted spaces from content. This mainly is text with attributes at the beginning of a line (or paragraph), throwing a space at the beginning. I believe this is due to \ul and \ulnone not properly concatenating to the content and requiring a space to be inserted.
     
    Dim r1 As Regex = New Regex("ulnone  \\par", RegexOptions.IgnoreCase)
    Dim r2 As Regex = New Regex("ul  \\par", RegexOptions.IgnoreCase)
    rtfString = r1.Replace(rtfString, "ulnone1", 1)
    rtfString = r2.Replace(rtfString, "ul1", 1)
    Dim newRTF As String = rtfString.Replace("Times New Roman", "Helvetica")
    newRTF = newRTF.Replace("\ulnone  ", "\ulnone1")
    newRTF = newRTF.Replace("\ul  ", "\ul1")
    newRTF = newRTF.Replace("\ulnone ", "\ulnone1 ")
    newRTF = newRTF.Replace("\ul ", "\ul1 ")
     
    With the above replacements, my RTF file appears proper in a variety of application (wordpad, wword, TextEdit, placed via indesign, and a few others).
     
    The font replacement is in there because although it has Helvetica defined as the default font (and appears as helvetica in CuteEditor) the resulting rtf has Times New Roman as the font.
  •  04-24-2011, 9:10 PM 67307 in reply to 67267

    Re: SaveRTF extra spaces

    Hi,
     
    Did you test other browsers ?
     
    Maybe the spaces are caused by browser.
     
    If so , we will fix this issue in browser code.
     
    If not , we will fix it in RTF code.
     
    We will check the RTF code at first.
     
    Regards,
    Terry
     
View as RSS news feed in XML