Beiträge von rgribeiro

    [UPDATE:]
    I found out an easier way to replicate the error:
    1- Create a new documento using WPT Editor Demo
    2- Press TAB three times and the insert an "<" symbol
    3- Save the file as DOCx
    4- Try to open it using Word or LibreOffice

    Apparently it happens only when TAB is inserted three times. Two and four TABs are OK.

    Hello
    I noticed what seems to be a bug in the WP7 DOCX writer plugin.
    I have a RTF file. When I open that file with the WPTools editor and save it back using the DOCx format both Microsoft Word and LibreOffice report the file as corrupt and refuse to open it. But the WPTools editor can open the DOCX file without problems.
    To reproduce the error just copy/paste the code below in notepad, save it as TXT and change the file extension to RTF. Then open it using the WPT Editor Demo, save it back as DOCx and try to open it with Word or LibreOffice Writer. Word will refuse to open it with a "XML parsing error".

    {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1046\deflangfe1046\deftab708{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
    {\*\generator Riched20 10.0.10240}\viewkind4\uc1
    \pard\sa200\sl276\slmult1\f0\fs20 Men below 50 years\tab\tab does not apply\tab\tab\tab <= -2,0: LOW BONE MASS\i\par
    }

    Hello

    I believe the DOCX writer add-on may have a bug. If I create and save a RTF document using WRichText v7.23, then open it again and save it as DOCX, some fonts get replaced in Microsoft Word.

    Try that:
    1-create a new document in WPRichText
    2-write "this lines uses Courier New"
    3-jump 2 lines and write "this line uses Arial".
    4-format the fonts accordingly to what the text says
    5-save the document as a RTF
    6-reopen it
    7-save it as DOCX
    8-open it using Microsoft Office 2013

    In my case, the Arial font is replaced by Courier new on the second line.

    Thank you for your answer, but the problem remains. But I think I found out what it was, and it had nothing to do with RTF merging.

    The problem with fonts being replaced when exporting to DOCX is related to the WPRichText default font (in my case, Arial). If I create a RTF document and a paragraph uses the WPRichText default font, Microsoft Word replaces that font with its default font (Times New Roman) when opening, as if it was plain text.

    I believe this is a bug in the WPTools DOCX reader-writer plugin.

    Hello. I need to insert a program generated RTF formatted string into a RTF document opened by a WPRichText component. Basically I have one document that works as a template, and I need to insert in the middle of it some RTF formatted text. I used to do it successfully like that:

    // loads the first RTF file into WPRichText
    WPRichText1.LoadFromFile('Template.RTF', False, 'RTF');
    // inserts the RTF formatted string at the end of WPRichText1 content
    WPRichText1.SelLength := 0;
    WPRichText1.CPPosition := maxint;
    WPRichText1.FastInsertParagraph;
    WPRichText1.SelectionAsString := rtf_formatted_string;
    WPRichText1.ReformatAll(true,true);"

    This works flawlessly when I save the final document as a RTF file, but when I save it as a DOCX file some fonts get replaced by Times New Roman.

    Is there a better way of inserting a RTF string inside another RTF document?

    Thanks

    Ok, I'll switch to WPRichText1.PrinDialog then. Do I need to add the "('')" at the end, like in "WPRichText1.PrintDialog('')"?
    As to the WPToolbar icons, they are rendered correctly in my computer but I just don't like their design, I prefer something more "MSWord like". I'll see if I manage to change the PNG file as you suggested.
    Thank you for the help and tips!

    Hello
    I'm currently using WPTools7 in my application, but a few customers are complaining about problems while printing (blank pages).
    I use a custom toolbar with a print button, which calls the following routine when clicked:

    "if PrintDialog1.Execute() then WPRichText1.Print;"

    Is this the correct way to do it? Or should I put some parameters like "WPRichText1.Print('@@DEFAULT@@')"? Or should I use "WPrichText1.Printdialog('')"?

    PS: I don't want to use the WPToolbar because the icons are too ugly.

    Thanks

    Hello all
    It seems to me that the TWPRichText control may have a few memory leaks (or else I'm doing something wrong). Try to do this:

    1-Create a new VCL Forms Application
    2-Add the line ReportMemoryLeaksOnShutdown := DebugHook <> 0; in the DR file, just before Application.Initialize;
    3-Drop a WPTRichText on the form
    4-Start the application and exit

    In my case I see a memory leak warning about two small blocks (TBitmap and TBitmapImage).
    Has anyone else seeing this? Or am I missing something?