Beiträge von ehimmer

    If I use a system with a standard 4x3 ratio screen, say 1024x768, and I have a WPRichText that has a WMF image in it and then export it to a PDF file, the WMF file looks fine, and character spacing in the WMF image is fine.

    However, if I take that same WMF file and add it to a WPRichText on a widescreen notebook, 1024x600, the image looks fine in print preview, but when exported to PDF, the text in the WMF overlaps the characters. In other words, the character spacing is compressed such that each char can overlap each other.

    It actually looks like the font size selected is different when used on a widescreen. And yes, I can take that same PDF, and view it on a 4x3 ratio screen, and it still is compressed... so it is selecting the wrong font when used on a widescreen in the WPPDFExport. Maybe the problem lies in the conversion of a WMF to JPG/BMP?

    I've emailed you sample files.

    WPTools 5.20.5
    wPDF 2.65
    Delphi 7

    Alessandro,

    I added the following "if SelLength" conditional to the front of your code, and it appears to now work like I want... maybe for you too:

    Code
    if (par <> nil) then
                            begin
                              if SelLength > 0 then
                              begin
                                CPPosition := SelStart;
                                par := ActivePar.prev;
                              end;
                              // empty, and non-numbered, remains searching

    I'll play with it to be sure it doesn't mess up anything... like perhaps I should reposition the cursor back to the last selected char at the end like it was to start with.

    Alessandro,

    I added your code snippet, but it didn't affect the outcome... starting a new numbered list with several blank paragraphs and non-numbered paragraphs between them still continued the sequence numbering instead of restarting it.

    I think this is because I highlighted three lines and clicked on the toolbar's numbered bullet button in order to set all the selected lines as numbered items (each item is a separate paragraph, which is common).

    I believe your search is starting with the third line of the hightlighted lines, so the first par it sees is the 2nd line of the newly numbered list. And since it is numbered, it continues the sequence rather than restarting.

    If I just position the cursor to the first of the three lines, and click the numbered bullet button, it works... but that is not the perfect solution in my case.

    Thanks though... maybe I can play with your code to get it to work like I want it to. (Update: see my next post for a possible solution)

    Just wanted to add my thoughts...

    Since my application combines multiple WPRichTexts to create a single WPRichText, using the numbered bullet as it stands today can be a bit of a problem...

    WPRichText1
    yada yada
    1. abc
    2. def
    3. ghi
    more yada yada

    WPRichText2
    1. jkl
    2. mno
    3. pqr

    Combined:
    yada yada
    1. abc
    2. def
    3. ghi
    more yada yada
    4. jkl
    5. mno
    6. pqr

    I'd personally like to see the default behavior be to start the sequencing at 1 anytime you set text as numbered bullets. Currently the user has to right-click the first item and do the popup menu thing mentioned in another post to set:
    ActiveParagraph.ASet( WPAT_NumberStart, 1 )

    And to my users, this has no visible effect until the two RichTexts are combined. So i know they are not going to remember to set this property since it looks correct while they are still separate.

    One note I just discovered,

    This bounding box with or without the X behavior does not occur when LayoutMode := wplayShowManualPageBreaks. The X is always present.

    You see this strange behavior when LayoutMode := wplayFullLayout (as in the video I sent you).

    But as I said before, I have to load the WPRichText using AsString, not AsANSIString( 'WPTOOLS' );

    Ahhh... found one difference... Ponder this:

    If I copy one RichText to another using:
    WPRichText_Cmt.AsString := WPRichText1.AsANSIString( 'WPTOOLS' );
    I do not get the bounding box.

    If I replace the line with this:
    WPRichText_Cmt.AsString := WPRichText1.AsString;
    I get the bounding box (but no X)

    If I have two bounding boxes (both broken image links), and I select one of them, the other one gets the X. But as soon as I unselect it, the X goes away, leaving just the bounding box. Likewise if I select the other.

    Got an explanation?

    I'm not really asking what code I can modify (to much to deal with when upgrading WPTools later)... but rather I was wondering where or why a broken image link now only displays a red bounding box rather than the historical red bounding box with an X through it?

    Again, 5.20.2 and earlier had the X'd bounding box, but 5.20.5 only has a red bounding box, as seen in print preview.

    **Update: playing around, I have another WPRichText that I had in my program, and if I delete the image referenced by the link, I get the X'd bounding box! So what determines 1) no bounding box, 2) empty bounding box, 3) X'd bounding box???????

    My other question is that since my print preview shows a bounding box, but my WPRichText editor does not (each are different WPRichText controls.. the preview is a composite of several WPRichText's) I thought maybe I was missing a property somewhere that isn't obvious to me even though I've compared the two.

    Any thoughts other than modifying released code? I can live with just a bounding box (will have to change all my documentation now), but I can't live without any kind of display in the editor. Thought you might now off the top of your head what the property I'm overlooking is.

    Thanks,

    Quick stupid question (seems I saw this somewhere, but can't find it now)...

    What determines what is presented if an image from an image link is not found?

    I have a case where the editor shows nothing, but print preview shows a red box (with 5.20.2 it was a red box with an X in it, now it is just a red box with 5.20.5). I'd like to have it show a red box (or a red box with an X preferrably) in all cases.

    WPTools 5.20.5
    Delphi 7

    When keying in some uppercase characters, I tend to hold the shift key down and key away rather than use the caps lock. I noticed that hitting the spacebar when the shift key is down does nothing... it should enter a space character.

    WPTools 5.20.2
    Delphi 7

    I found an example of using the Microsoft Ink features within Delphi 7, and used it to copy the signature to the clipboard and then pasted from the clipboard into the WPRichText as an embedded bitmap image.

    This seems to work just fine for what I needed!

    For those who are interested:
    http://cc.borland.com/Item.aspx?id=22684

    This references the required dev tools to develop ink features using a non-tablet PC, plus points you to an example written in Delphi. Turns out to be very simple!

    I asked this a couple of years ago when there was no support yet, so now I thought I would ask again since I realy need this ability now (back then it was just something that would have been cool)...

    Does WPTools support or has someone written support for the ink object when using a tablet pc (Delphi 7)? I'd like to support the ability to allow a user on a tablet PC to sign a document presented within a WPRichText control.

    I might even pay someone to have this ability added :D

    Thanks!

    Will this solution be integrated into a future release so we don't have to make the change everytime I update WPTools? I guess we could always implement our own dialog, but it might be good to integrate it for general usage.

    If I add two images (links) on the same line, and then click the center justify toolbar icon, it centers the first image, seemingly ignoring the second image entirely, other than keeping it to the right of the first image.

    However, if you modify that line in any way, like add a space between the two images, it centers appropriately... well until you add a new paragraph anywhere, and then it re-centers the images based on only the first image.

    I hope I made some sense.

    WPTools 5.202
    Delphi 7

    Sorry, but I'm not sure I understand how that answers my question as to what page i'm on in order to modify the NUMPAGES in OnTextObjGetTextEx so that I can adjust NUMPAGES on the fly depending on what physical page is being printed.

    Or I'm just way out in left field and have to look at this problem in another light.

    OK... I'm back revisiting this and I can now adjust the pagenumber in TextObjGetTextEx when the text object is 'PAGE', but for the life of me, I can't figure out how to adjust the page count for Text Object 'NUMPAGES' since I don't know what page I'm on when getting the 'NUMPAGES' text object (WPRichText.Memo._CurrPaintedObjPageNumber seems to be meaningless during this event)

    For example, the whole doc might be 10 pages, but I want the pages numbered like this in both print preview, printed and when exported to PDF:
    1 of 1
    1 of 5
    2 of 5
    3 of 5
    4 of 5
    5 of 5
    1 of 4
    2 of 4
    3 of 4
    4 of 4

    I hope it is something simple that I'm just not seeing.

    WPTools 5.202
    Delphi 7

    As always, thanks!

    Hold on... Maybe I don't understand the option.

    I was trying to create a table within cell 3 row 1 of another table, but when I clicked on the table Icon, it inserted the new table as a new table row, and not within the cell.

    I invoke the WPTableDlg when this icon is clicked.. does that make a difference?

    I think the problem came about, in theory anyway, during the import within my program. At the time of import, the image link is valid since the images were copied into the temp folder which matches the image links. I parse the WPRichText to convert several of my own id's stored in hyperlinks to correspond to the new location where I'll be storing the imported documents. At the same time, I change the image link to correspond to the new location, but that link is invalid at that moment, and save the WPRichText back into a database.

    I think that saving into the database when the image link is invalid is the problem. It seems to have gone away now that I copy the images first so that the image link is still valid before I save the WPRichText.

    Is my theory valid? Just curious as I'm good to go, but this is not the first time the image link being invalid in some of my import/export/cloning routines have haunted me.