Text not wrapped on converting from RTF to PDF.

  • Hi,
    I am working on a project that needs to convert an RTF file to PDF. I have downloaded this evaluation version of RTF2PDF and when tested I cant see the exact results I want. Following are the issues

    1. Text is not wrapped in table cells. Its overflowing to the next cell.
    2. Background colours of the cells are not retained.

    I am not sure whether its becauase of the evaluation version.

    Regards
    Kiran[/img]

    • Offizieller Beitrag

    Hi,

    Is it possible that the cells are marked to not wrap the text? We support this feature. Usually the text is always wrapped.

    If the format looks ugly it is possible the the text was internally not reformatted. This reformat is required if the text was created dynamically using the TWPEditor and TWPTextCursor interfaces. (property "Memo")

    Maybe you can send a sample of your RTF file ?

    Regards,
    Julian

  • Hi,
    Thanks for the reply.
    I am not sure whether the cells in RTF file are wrapped.
    But when I use Adobe PDF writer plug in to convert this RTF file to PDF its working fine.
    Its showing all colours and formatting.
    I am attaching an image that shows two resulting PDF files one from ADOBE and other from wptools.
    It might be because in my program I am loading the RTF file into a Rich Text control and converting it to PDF as it showed in the demo.
    I am using PDFControl1.ExecIntCommand 9, RichTextBox1.hwnd command.
    May be there is another way of doing it like converting source file directly to the destination file.

    Also attached sample RTF file.

    Regards
    Kiran

    • Offizieller Beitrag

    Hi,

    thank you for the file and the explanation.

    The problem is that you use

    PDFControl1.ExecIntCommand 9, RichTextBox1.hwnd

    which basically uses the richedit DLL to render the text. Here you do NOT use our RTF conversion engine - it is
    superior to the RichText Box, esspecially with tables,
    header and footers, images and alike. It even does
    footnotes!

    You will get a better result if you use the RTF2PDF feature
    of the PDFControl demo. (Note, this is an addon license)

    This RTF2PDF feature is very powerful and you can even
    create such a table under program control in case you can
    use COM interfaces. It also does HTML to PDF.

    Regards,

    Julian

  • Hi Julian,
    Actually I am using code from RTF2PDF feature from PDFControl demo that I downloaded.

    The code I am using in my VB6 program to convert RTF to PDF is

    Private Sub Command1_Click()
    LoadEMFFile.Action = 1
    If LoadEMFFile.FileName <> "" Then
    RichTextBox1.LoadFile FileName
    End If

    End Sub

    Private Sub Command2_Click()
    If PDFControl1.StartEngine(DLLName.Text, "LicenseName", "LicenseCode", 0) = True Then
    PDFControl1.BeginDoc FileName.Text, 0
    PDFControl1.ExecIntCommand 9, RichTextBox1.hWnd 'intern command to draw a richedit (using a fixed border 0.5 inch and current page size
    PDFControl1.EndDoc
    Else
    MsgBox "We were not able to load the PDF Engine DLL", 0, "Error!"
    End If
    End Sub


    This code I got from ....\wPDFControl\Demos\VB6\RICHEDIT
    So I would say this is the code I was looking for.
    If you got different link/code for VB6 to convert from RTF to PDF please provide me.

    And I am very glad to get the answers back from you very quickly.
    Only problem is the time difference between you and me.

    Thanks

    • Offizieller Beitrag

    Hi,

    the demo
    ....\wPDFControl\Demos\VB6\RICHEDIT

    will simply not render your complicated text correctly. The richtext DLL is not capable too.

    You can use the internal RTF engine - from your mail I know you now do - and you get a much better result.

    Currently there is a problem with table borders - they are duplicated - this will be fixed in next release.

    Julian

  • Thanks for sending me the new version to evaluate.
    Now there are no duplicate table borders in my PDF document.
    I am very much happy with this control and will contact you soon for purchasing it.

    I can say the response time for the questions asked is very quick.

    Thanks
    Kiran