Clipboard Problems

  • 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.

    • Offizieller Beitrag

    Hi,

    I can only try to reproduce this with an example PDF. Some PDFs cannot be converted to text very well, this has a lot to do with how the text was added and if proper ToUnicode tables are there.

    Julian