Beiträge von psswp

    I assign "Source" instead of "Name" in the last code above. That is

    Zitat

    WPRichText1.TextObjects.Insert(TextObject);
    iK := WPRichText1.TextObjects.ObjCount;
    WPRichText1.TextObjects.ObjList[iK-1].Source:= 'Paint';

    Doing so, it seems that the image is saved blank.

    If in the above code, I use "Name", instead "Source", then it is working correctly.

    I am saving a bitmap created in the same application using standard Delphi components.

    I insist in to embed the image into the rtf, so, following your suggestions, I am using this code that now is working:

    Code
    TextObject := TWPOImage.Create(WPRichText1.Memo.RTFData);
      TextObject.LoadFromFile(sFle);
      WPRichText1.TextObjects.Insert(TextObject);
      iK := WPRichText1.TextObjects.ObjCount;
      WPRichText1.TextObjects.ObjList[iK-1].Name := 'Paint';

    While testing this solution, using .Source property instead of .Name, I can see the image on screen, but once the RTF document is saved, when I reopen, the image is blank, perhaps Source is intended to content another type of information.

    Using XE7 with WPT 7.21
    I want to identify one of several images in a document for providing editing functionality for this image.
    So, I insert the original image into the document using the following code, and try to keep some identification of that image using the properties FileName, Extra, ObjTag and Tag

    Code
    TextObject := TWPOImage.Create(WPRichText1.Memo.RTFData);  TextObject.LoadFromFile(sFle);TextObject.FileName := 'Paint';      TextObject.Extra := 'Paint';TextObject.ObjTag := 6969;TextObject.Tag := 6969;WPRichText1.TextObjects.Insert(TextObject);

    If I remain in the current editing sesión of the document, I can retrieve those properties, but if I save the document, and later open again, then those properties are not saved in the RTF.
    I want to use the following code, but any of the FileName, Extra, ObjTag and Tag has any value.

    So, what property of the actual object must I use to persist a value for identifying that image

    I have a single page A5 RTF document (210x148) that is designed in horizontal position, that is, the wide 210 part is at the top.

    As the main use of the printer where this document is printed is for other tasks, this printer is configured to print the A5 documents in vertical position, that is, the 148 part is at the top.

    Configuring the printer to print portrait/landscape does not do the trick, so what can I do to print the document sideways.

    Further investigating, I see that the bootleneck is not at all in the loading of fonts, but in a message in TWPCustomRtfEdit.WndProc

    If you put a breakpoint in the event FormShow of WPMiniEditUnit1, then once stopped there put another breakpoint in TWPCustomRtfEdit.WndProc
    look for the 5 next events and in the 6 event of type 45063 is what is causing the bootleneck.

    As I do not have Windows SDK headers, I can not follow what the 45063 message is.

    My customer has several PC workimg with my application, but one those PC is very slow loading my RTF editor form.
    I tested with WPMiniEditor.exe demo, and here are the results:

    WPMiniEditor.exe demo, Customer PC loading time: 18 seconds, My PC loading time: 3 seconds.

    My application, loading time for the RTF editor form, Customer PC loading time: 33 seconds, My PC: 2 seconds.
    My application, unoading time for the RTF editor form, Customer PC 25 seconds, My PC: 0 seconds.

    I looked at the fonts catalog, but there is no significative differences, Customer has 237 fonts, and in my PC there are 351 fonts.

    I am lost with this problem, so can anybody give me any clue on to diagnose what is happening,

    Using XE7 with WPTools 7.21
    In a RTF document, I need to replace some code (sort of my own mailmerge implementation) with plain text that contains CrLf pairs.
    Here is what I am using, and it does not work

    In either case, letting CrLf as is or replacing with Lf, activating the view of control chars in the RTF editor, it apears a broken arrow, and I cannot access the first character of the second line.

    Using XE7 with wPDF 4 Standard.
    I am creating PDF files from WPRichText RTF documents.
    To do it, I use the following code

    Code
    pdf := TWPPDFExport.Create(Application);
      pdf.DLLName    := sPath + '\WPDF400W.DLL';
      pdf.FontMode   := wpEmbedType3;
      pdf.Source     := WPRichText1;
      pdf.FileName   := sFlePDF;
      pdf.Print;


    I see that the length of the generated PDF differs from what is in the WPRichText, if WPRichText is 1 page long, the PDF file needs 2 pages, and the last few lines goes to the second page.
    Is there any way to map exactly the WPRichText RTF document length to the PDF file.

    In my application, there is an option for the user to insert images into WPRichText.
    After the image is inserted, the user later must be able to recall the inserted image for further editing (double clicking on the image), so, I am looking for a way to keep the physical path of the image as a reference in the corresponding TWPTextObj.
    Once the physical path is obtained, I will call the image editing program, and once edited, I will replace the selected image with the new one.
    I see that the TWPTextObj has a "Tag" property that could help with an index to the image, but it is not accessible.
    Also there are "FileName" and "Extra" string properties, that are not updated after calling TWPTextObj.LoadFromFile.
    Could those properties be used to keep the physical path of the image, or there is a best way to do what I need.

    In a mailmerge routine, I need to delete full lines of text if besides a special code the line contains only spaces and tab characters, so I use the following routine.

    The problem is that although WPRtf1.Text is working as expected, it seems that after this routine, the RTF formatting is lost when rendering on screen (text color, bold, underline, etc).
    If I use WPRtf1.AsString, I can see all the RTF code plus my text, but that formatting is not rendered on screen, even if I am using ReformatAll to synchronize.

    When including FontName and FontSize listboxes in the toolbar, loading the editor form is delayed by a few seconds, but I found that in the A)_Mini_Delphi5_Editor\XE3 demo, the loading of those listboxes is done in the first click to the listbox.

    I do not see any related parameter in the demo, but I see IgnoreFonts in the manual. So, how is this done

    Working with XE7 and WPTools 7.21
    I am creating a table with 10 columns as follows

    I see that the last column does not size to 1.5 centimeters as the others, but expands to the full available width of the page.

    I do not know if there is some parameter for telling the global with of the table, and that it does not expand to the full width of the paper.

    There is some differences if you call the PageSetup dialog by code or use the menu File -> Page Settings, but in all cases, some parameters are not set. I will explain:

    Using your code, and executing the PageSetup dialog by code, here is how I connect the components:

    Code
    mWPDefaultActions := TWPDefAct.Create(Self);
    WPRichText1.PaperDefs.Init(true);
    WPRichText1.ReadPrinterProperties;
    WPRichText1.Header.Landscape := False;
    WPRichText1.Header.PageSize := wp_DinA5;
    WPRichText1.Header.UsedUnit := UnitCm;
    mWPDefaultActions.WPPagePropDlg1.EditBox := WPRichText1;
    mWPDefaultActions.WPPagePropDlg1.Execute;

    Using this code, I can see the PageSize changed in the PageSetup dialog, but not the UsedUnit, that continues to be inches.

    If in Form_Load I setup all the code above, except WPPagePropDlg1.Execute and I call File -> Page Settings menu, then PageSize nor UsedUnit are changed in the PAgeSetup dialog.