Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / CopyToClipboard Method
Example





In This Topic
    CopyToClipboard Method (GdViewer)
    In This Topic
    Copies the current page, that means the content of the whole page, of the document displayed in the GdViewer control into the clipboard as an image.
    Syntax
    'Declaration
     
    
    Public Function CopyToClipboard() As GdPictureStatus
    public GdPictureStatus CopyToClipboard()
    public function CopyToClipboard(): GdPictureStatus; 
    public function CopyToClipboard() : GdPictureStatus;
    public: GdPictureStatus CopyToClipboard(); 
    public:
    GdPictureStatus CopyToClipboard(); 

    Return Value

    A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
    Remarks
    Please note that this method expects to have a core GdPicture license to be unlocked.

    Be aware that the currently displayed page, even if it is a text-based, is copied into the clipboard as an image.

    Example
    How to copy the page content to the clipboard.
    'We assume that the GdViewer1 control has been properly integrated.
    If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
        If GdViewer1.CopyToClipboard() = GdPictureStatus.OK Then
            MessageBox.Show("Done!", "GdViewer.CopyToClipboard")
        Else
            MessageBox.Show("The page content can't be copied. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CopyToClipboard")
        End If
    Else
        MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CopyToClipboard")
    End If
    //We assume that the GdViewer1 control has been properly integrated.
    if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
    {
        if (GdViewer1.CopyToClipboard() == GdPictureStatus.OK)
        {
            MessageBox.Show("Done!", "GdViewer.CopyToClipboard");
        }
        else MessageBox.Show("The page content can't be copied. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CopyToClipboard");
    }
    else
        MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CopyToClipboard");
    See Also