I have a program in which I managed to copy content as PDF to the clipboard using some undocumented functionality. Unfortunately this data is note pasteable even to programs that accept PDF. I managed to use this program to find that it can be made pasteable by changing the description (or type) from "PDF" to "Portable Document Format" (see screenshot below). Unfortunately this program also corrupts the data when doing this. (I think this is because the data is binary and not text)

How can I change the description/type of the Windows clipboard data without changing the (binary) data itself?

Mathematica graphics

My previous related question: How to access raw clipboard data on Windows?

  • 1
    " using some undocumented functionality" --- there's a reason why it's undocumented Snd you're seeing the effects of it – Sathyajith Bhat Jan 15 '12 at 2:31
  • @Sathya What is wrong with trying to reverse engineer how the program works? Also, my question is not about that functionality, but about how the clipboard works. – Szabolcs Jan 15 '12 at 7:55

It’s not possible. Data in the clipboard are OLE objects.

| improve this answer | |
  • 2
    I am not familiar with OLE objects. Can you elaborate and explain why it's not possible to retrieve the binary data and re-insert it to the clipboard using a different type? In this case it seems the clipboard contents are simply the contents of a PDF file. This program I mentioned will randomly not display the contents properly (see the empty screenshot) event though it does say the size of the data. I need to reinsert this data into the clipboard and call it Portable Document Format rather than PDF. – Szabolcs Jan 14 '12 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.