Beiträge von asniemann

    I create my WPViewPDF like this:

    Code
    WPViewPDF1 := TWPViewPDF.Create(Self);  WPViewPDF1.ViewerStart('', );  WPViewPDF1.Parent := plPDF;  WPViewPDF1.Align := alClient;  WPViewPDF1.ViewControls := [wpViewLeftPanel, wpHorzScrollBar, wpVertScrollBar, wpNavigationPanel, wpViewPanel];  WPViewPDF1.ViewOptions := [wpDontHighlightLinks, wpViewThumbnails];  WPViewPDF1.OnHyperlinkWWW := PDFHyperLink;  WPViewPDF1.MouseMode(wpLeftButton, wpmSelectText);

    And on Ctrl-C I call this:

    Code
    WPViewPDF1.command(COMPDF_CopyToClibrd);

    All of my PDF files are generated by SQL Server Reporting Services.

    I have the following problems:
    1. Sometimes Ctrl-C puts the highlighted text onto the clipboard and sometimes it does not - I cannot find any clues as to why this happens.
    2. Sometime the second (and additional) times I select text, the original selection stays highlighted, so it becomes difficult to know which text will be copied.
    3. Most of the time the text on the clipboard (when it works) contains an additional letter -the one just prior to the highlighted selection.
    4. I tried to enable/disable the copy button based on selection length but it was always 0.

    Can you help me with any of these - as it is I can't give it to my clients because it appears to behave very inconsistently.

    I thought moving to the live version might solve this so I went ahead and purchased it. Now I have a different problem...

    When I call pdfPrint using these credentials I get an error code -1.

    Here is my code (PDFFile is a string with the file path/name and Options is a string with options):

    Testvar := pdfPrint(PChar(PDFFile), '',
    PChar('Anthony Niemann'), PChar('L***************2'), 1*****0,
    PChar(Options));

    I am using RAD Studio 2009.

    What am I doing wrong?

    Thanks,
    Tony

    I am trying to use the demo for pdfPrint and no mater how I send the filename parameter wPDFView always takes the first character of my parameter and appends it to the application path and then fails...

    For example I call this:

    pdfPrint('NFA_Letter.pdf', '', '', '', 0, '');

    And get the error
    'c:\my\app\path\N' not found.

    Thanks for any assistance,
    Tony

    In an attempt to block this in my code I have added the following BeforeCopyText procedure to all my TWPRichText objects.

    Would this ever not work?

    Thanks,
    Tony

    Julian,

    I found that pasting text from the clopboard was not triggering the OnChange event. I made the following 2 changes to WPCTRMemo in the TWPCustomRtfEdit.PasteFromClipboard procedure:

    ...

    Code
    finally      if Reader <> nil then      begin        Reader._DefaultImage.Free;        Reader.Free;      end;    end;    if load then                               //ZNC 09/26/2005      ChangeApplied;                           //ZNC 09/26/2005    if not TryWithImages then exit;

    ...

    Do these changes look acceptable to you?

    Thanks,
    Tony

    Ah, but it is getting copied in the circumstance I oulined in my first post.

    The difference between my code and your demo is that you didn't put any text in the wpIsXMLTopLevel paragraph, instead you painted the text yourself. My text is of varying length and may be more than one line, so I put the text into the paragraph to let the control handle word wrapping.

    In the demo you can't copy part of the "header" paragraphs because the control doesn't know there are words there (since you painted them).

    In mine however it is allowing the user to select part of the paragraph if the selection area extends outside of the wpIsXMLTopLevel paragraph. This is what I need to prevent, but have been unable to figure out.

    Thanks for any help you can offer.
    Tony

    I create the paragraphs like this:

    I have the following ProtectedProp setting:
    [ppParProtected,ppCheckAllText,ppNoNewParagraphsInEditFields,ppProtected,ppIsMergedText,ppProtectSelectedTextToo,ppNoEditAfterProtection]

    If I understand correctly, the protected text is not "field".

    Tony

    I have some protected text in my document. If the user selects a range starting before the protected text and ending after it, they can't copy it. However if they select a range starting inside the protected text and ending outside then they can copy it.

    I have tried every ProtectedProp but nothing changes this.

    I thought perhaps the OnBeforeCopyText would be the place to prevent this but I can't figure out how.

    Any help would be appreciated.
    Tony

    I was having a problem with users having a readonly RichText and still being able to Cut text from it. I found that the OnBeforeCutText wasn't getting called on a Cut, only on a Copy. Here is my patch, it may not be the approach you want to take, but it does solve the problem.
    Tony

    [/code]

    Julian,

    I added the $IFDEF/$ENDIF manually for the second occurance mentioned in the first post. I just wanted to confirm that you saw that and that it would be in the next release.

    Thanks as always,
    Tony

    When I run the Sub Paragraph demo and click on the load button, the ANSI fields load correctly but the RTF field writes it's first line ("Some RTF Text") on top of the parent bar, overwriting the "Field B" label.

    If I click on the save button this first line is lost and "a" becomes the first line in the Field B TWPRichText box.

    I would like to use this feature, but I need to resolve this issue first.

    Thanks,
    Tony

    I'd just like to add that not only is Modified not set, the OnChange event is not triggered.

    In addition doing a spell check with Addict using your recommended technique does not change Modified even if you change the spelling of a word.

    Will this be corrected or should I be looking for a work around?

    Thanks,
    Tony

    I am refering to the horizontal ruler which in my case is placed directly above the rich text box. Both the ruler and the rich text box are together on a panel with a vertical ruler and a WPToolBar. I actually started by copying the page from your demo (SuperMrg).

    I just went back and ran the demo and the same thing is happening in the demo, so you can look at that.

    Thanks,
    Tony