Beiträge von Markus

    Hi,

    I am working with an editor that was created with

    Code
    WPRTF := TWPCustomRTFEdit.CreateDynamic;

    So the editor has no Parent WinControl. After doing some routines I want to draw some graphics on the editors canvas. But doing so I receive the error that the element has no parent control.

    Where or how can I get a valid canvas to do some drawing on the editors canvas?

    Markus

    Hi,

    I just tried to insert a BackgroundImage for a specific paragraph. Do do so I used the following code:

    Code
    WPRichText1.ActiveParagraph.BackgroundImage := WPLoadObjectFromFile(WPRichText1.RTFData, 'C:\Temp\Pic.jpg', false);

    As a result I can see the picture as a BackgroundImage. Everything seems to be correct. But when I save the rtf file the picture is gone. Closing and reopening the rtf file will show that the picture was definitly not saved.

    What's wrong?

    Regards Markus

    Hi,

    I am trying to set the Header- and Footer margins for a specific section. When I call the PageProp Dialog in the main section the dialog allows me to set these margins. But for another section the dialog does not show these properties. I am using the following code to call the PageProp Dialog:

    Code
    WPPagePropDlg1.EditBox := CurEditor;
      if CurEditor.ActiveParagraph.CurrentSection <> nil then CurEditor.ActiveParagraph.CurrentSection.Select := [wpsec_PageSize];
      WPPagePropDlg1.ExecuteEx(CurEditor.ActiveParagraph.CurrentSection, self.Handle);

    Can I force the Dialog to show these properties for all sections?

    Thanks and regards
    Markus

    Hi,

    I draw Text on a TCanvas with TWPPaintEngine. All works well but after I draw the Text on the canvas I want to do some more operations in the rect where the Text was drawn. How can I get the rectangle in pixels of the canvas where the TWPPaintEngine draw the text?

    I've tried this:

    Code
    w := WPPaintEngine.Memo.TextWidth div WPPaintEngine.Memo.CurrentXPixelsPerInch;
              h := WPPaintEngine.Memo.TextHeight div WPPaintEngine.Memo.CurrentYPixelsPerInch;


    but that results to no usefull values.

    Thanks in Advance!

    Regards Markus

    Yes that works. But I had to add a further line of code:


    Code
    WPRichText1.SetFocus;

    before calling the BookmarkSelect function from a non modal popup form. After that it worked.

    Thank you!

    Hi,

    I am using the function WPRTFEdit1.BookmarkSelect. So far so good it works and selects the Text that is associated with the bookmark. But the editor doesn't scroll to the marked position. So in a long text you must scoll yourself to find the selected text. Is it possible to automatically let the editor scroll in view.

    Hello,

    as described in the PDF Manual for WPTools 6 I am using the function ExecuteEx for the page property dialog and hand over the ActiveSection. I would expect that only this ActiveSection would be affected by the settings of the dialog but after clicking ok the whole document changes. Before calling the page prop dialog with ExecuteEx I insert a new section with the following code:

    Code
    WPRichText1.InputString(#12);
    WPRichText1.ActiveParagraph.StartNewSection;

    Did I forget something?

    Thanks for any reply!

    Hi!

    Is it possible to detect the position of a paragraph on its page in centimeters or twips? I want to implement a routine that adds a PageBreak when a particular paragraph is beyond a specific position on the page. The number of characters is not suitable.

    Thanks Markus

    Hello,

    I created a Document in MS Word and placed a regular shape (rectangle) on the document. After converting it to RTF I opened it with a WPTools editor but I couldn't see the shape. Everything else is fine but the shape is not there. Is this a general problem of WPTools? Or do I have to regard some special settings in the WPTools editor?

    Anyway. Is there a most compatible MS Word configuration for the WPTools RTF engine?

    Hi,

    how can I set the Spacing between table cells? I tried this but it didn't work:

    Code
    CurTable.ASet(WPAT_CellSpacing, WPCentimeterToTwips(0,2));

    The parameter WPAT_CellSpacing is in the interface but I can't find any documentation for it.

    Hi I am just struggling with another problem. I merely want to change the font size of a paragraph. But whatever I do it wont work. I use the following code:

    Code
    //Fontstyle of title row -> this works
          TitleFontStyle := RPTable.RTFGetTitleFontStyle;
          if TitleFontStyle > 0 then
            if IsTitle then CurRow.ASetCharStyle(true, TitleFontStyle) else CurRow.ASetDelCharStyle(TitleFontStyle);
    
    
          //Fontsize of title row -> this don't work
          if RPTable.TitleFontSize >= 0 then
            CurRow.ASet(WPAT_CharFontSize, Round(RPTable.TitleFontSize*100));

    Any idea what I do wrong?

    Hi,

    I am just working on the following problem. I have a certain text in an RTF file. I search this text with the Finder Object which works fine. Instead of the found text I want to place a table. For that I am using the TableAdd procedure. Also no problem everything works. But whatever I do the table I am created has a totally differnt formatting than the text I replaced. For example the replaced text (paragraph) had Verdana 10 and the table has Arial 11. I tried a lot of things. Has anybody an idea how to format the table in exact the way the replaced text was formatted?

    Thanks

    Is it possible to insert an image link in plain RTF code rather than embed the image data? Somthing like:

    { /piclink "c:\temp\somepic.jpg"}

    We have the need for this because we must parse a plain rtf file for some serach tags before assigning it to WPTools.