Determine if there is PDFEdit items in clipboard...

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Determine if there is PDFEdit items in clipboard...

Post by lidds »

I have created my own custom contextMenu for various reasons, however I need to determine if the clipboard contains any PDFXEdit elements. I have tried the following, but this is not working and I was wondering if you could give me a sample of how you currently do this?

Code: Select all

        Dim hasPDFData As Boolean = False

        Try
            Dim dataObject As PDFXEdit.IDataObject = TryCast(Clipboard.GetDataObject(), PDFXEdit.IDataObject)
            Console.WriteLine("current PDF clip object: " & dataObject.ToString)
            hasPDFData = True
        Catch ex As Exception
            Console.WriteLine("error getting clipboard data format: " & ex.Message)
        End Try

        If Clipboard.ContainsAudio = True Or Clipboard.ContainsImage = True Or Clipboard.ContainsText = True Or hasPDFData = True Then
            Me.btnDropPaste.Enabled = True
        Else
            Me.btnDropPaste.Enabled = False
        End If
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Determine if there is PDFEdit items in clipboard...

Post by Sasha - Tracker Dev Team »

Hello Simon,

We are doing this:

Code: Select all

::SetClipboardData(::RegisterClipboardFormatW(L"PXCEditCbData"), NULL);
Basically, you can check the clipboard format and see whether it's the above.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Determine if there is PDFEdit items in clipboard...

Post by lidds »

Alex,

This code does not seem to work, errors all over the place, is this C++ code? Need this in C# or VB.Net
clipboard.png
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Determine if there is PDFEdit items in clipboard...

Post by Sasha - Tracker Dev Team »

Hello Simon,

Of course it's a C++ code, and it's how we are setting the clipboard format. Use Google/MSDN to find appropriate methods for .Net to read the clipboard format.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Determine if there is PDFEdit items in clipboard...

Post by lidds »

Sorry Alex,

Completely miss read your latest post.

Code: Select all

If Clipboard.ContainsData("PXCEditCbData") Then
                hasPDFData = True
            End If
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Determine if there is PDFEdit items in clipboard...

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply