in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

RTF rendering problem

Last post 04-03-2008 1:08 AM by C1_Dima. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 11-04-2006 4:28 PM

    RTF rendering problem

    Hi, I have a problem with RTF rendering.

    When I render RTF file, each line of the file is placed on seperate page. I using the following code:

    DOC1.StartDoc()

    f = New System.IO.StreamReader("001.rtf")

    s = f.ReadToEnd

    f.Close()

    DOC1.RenderBlockRichText(s)

    DOC1.EndDoc()

    Can somebody help?

    Alexander

     

     

  • 11-04-2006 9:49 PM In reply to

    Re: RTF rendering problem

    Alexander,

    I have a similar problem but it only happens on Win2000 (not XP). Which OS
    are you having the problem with?

    Russ Stevens
  • 11-06-2006 8:56 AM In reply to

    Re: RTF rendering problem

    Russ,

    Thank you for your help, I have tried the application on XP, and it's working well. I have problem only on Win2000. Do you know the reason of this problem?

    Alexander Nagy

  • 11-06-2006 9:31 AM In reply to

    Re: RTF rendering problem

    Alexander,

    It would appear to be a bug with C1 or the rtf dlls with Win2K. I have
    previously reported it and submitted a .c1d file. Perhaps they can duplicate
    it with your sample code. It pretty much makes doing anything with C1 and
    rtf on Win2K impossible.

    Russ Stevens
  • 03-31-2008 9:29 PM In reply to

    Re: RTF rendering problem

     Did anyone ever get an answer to this?  Does moving up to the latest release help?  We are having the same problem where each line prints on another page with RTF. 

    Filed under: ,
  • 04-01-2008 1:37 AM In reply to

    Re: RTF rendering problem

    Please post a sample and indicate which version of C1Preview you're using, and I will look into this. Thanks. 

    Cheers,
    Dima.
  • 04-01-2008 9:40 AM In reply to

    Re: RTF rendering problem

     Our problem is occurring on Win2K only.  We are using version 2.6.20063.304.

     What we are doing is similar to the original post except we use RenderDirect(x, y, obj). 

    DOC1.StartDoc()

    Dim objRender As C1.C1Preview.RenderRichText
    objRender = New C1.C1Preview.RenderRichText(
    DOC1)

    objRender.rtf = <rich text string>

    DOC1.RenderDirect(x, y, objRender)

    DOC1.EndDoc()

     I am hoping that there is a fix available or an upgrade will help.

     Thanks,

    Steve

     

     

     

    Filed under: ,
  • 04-01-2008 12:43 PM In reply to

    Re: RTF rendering problem

    Please provide the EXACT RTF string or file that you're using. As I said, better yet please provide a complete sample that I can actually run. Thanks. 

    Cheers,
    Dima.
  • 04-01-2008 1:19 PM In reply to

    Re: RTF rendering problem

    How's this?  I can provide a zip file of the solution if you want the whole thing but I will need an email to send it to because I cannot attach here.

     

    Imports C1.C1Preview

    Public Class Form1

        Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim c1PrintDocument As New C1PrintDocument()
            Dim objRender As New RenderRichText(c1PrintDocument)

            objRender.Rtf = RichTextBox1.Rtf



            c1PrintDocument.Body.Children.Add(objRender)
            c1PrintDocument.StartDoc()
            c1PrintDocument.RenderDirect(1.0, 1.0, objRender)

            'c1PrintDocument.EndDoc()

            Dim preview As New frmPreview()
            preview.C1PrintPreviewControl1.Document = c1PrintDocument
            preview.ShowDialog()
            preview.Dispose()




        End Sub

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            RichTextBox1.Rtf = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}{\colortbl ;\red0\green0\blue255;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 Welcome to \b ComponentOne HelpCentral\b0 , the online resource for Visual Studio developers and Help authors. Use the \b Quick Links\b0  on the left side of this page to locate information pertaining to specific ComponentOne products. Enter a question or phrase into the \cf1\ul Search HelpCentral <Search.aspx?Refresh=1>\cf0\ulnone  box to search the online knowledge base. Visit the \cf1\ul Product Forums <Forums.aspx>\cf0\ulnone  page to participate in peer-to-peer discussions or to search the archives for newsgroup and forum posts for individual products.\par\pard\f1\fs17\par}"
        End Sub
    End Class

    Filed under: ,
  • 04-01-2008 2:58 PM In reply to

    Re: RTF rendering problem

    You should be able to use the "Contact" link on my posts to send me an email. 

    Cheers,
    Dima.
  • 04-02-2008 10:55 AM In reply to

    Re: RTF rendering problem

    I don't think there ever was a build  2.6.20063.304 - there was a  2.6.20063.334 though, so I assume you mean that.

    Most probably the problem is caused by an old version of MS RTF dll(s) on that system. Try locating a newer msftedit.dll (e.g. version 5.41.15.1509 works fine) and put it in the same directory with your app's executable. Hope this helps.

    Cheers,
    Dima.
  • 04-02-2008 11:46 AM In reply to

    Re: RTF rendering problem

     Well that worked for us.  We took the msftedit.dll off of an XP machine and put it in the project directory on the Win2k machine and it worked.   Did you have to do this on your Win2K machine or did the proper version already exist?  What Service Pack do you have installed on the Win2K machine?    I need to identify the proper SP or hotfix which includes the correct dlls.

    Filed under: ,
  • 04-02-2008 3:50 PM In reply to

    Re: RTF rendering problem

    AFAIK, the msftedit.dll is shipped with several MS products, e.g. with Office. It also ships with the newer operating systems (Vista). I do not know which Win2K SP - if any - installs it. I would suggest you contact Microsoft to get this info.

    Cheers,
    Dima.
  • 04-02-2008 4:20 PM In reply to

    Re: RTF rendering problem

     Dima,

    I appreciate your patience.  This is what I have found in my research with Microsoft.  RegEdit 4.1 (or msftedit.dll) is not supported on Windows 2000. Before msftedit.dll they had RegEdit 1 thru 3 - or RichEd20.dll.  That is what ships with Win2K.  It seems like that it would follow then that there are some unsupported features (ie. Rending Rich Text) of the C1 components on a Win 2K environment. 

    I don't know how msftedit.dll got on your Win2K machine.  It might have been installing MS Office or it may have been manually copied.  However, I cannot reasonably ask my customers to install MS office on their Win2K machines in order to get this to work properly if that was in fact how it got there.   I can find no SP or hotfix that places msftedit.dll on a Win2K machine.

    Here is the link : http://msdn2.microsoft.com/en-us/library/bb787873.aspx

    Thanks,
    Steve

     

     


    Filed under: ,
  • 04-03-2008 1:08 AM In reply to

    Re: RTF rendering problem

    Thanks for the info/link. You cannot ask your customers to install MS Office, but I think you could include msftedit.dll in your app's installation - provided of course that MS licensing allows it (which I do not know). Not really sure what else to suggest - our RTF support relies on whatever is provided by the system, and I don't think we can or should change that.

    Cheers,
    Dima.
Page 1 of 1 (15 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.