No worries, everyone starts somewhere. (But you should probably start with Google, wikipedia, or a lesson rather than starting out asking on StackOverflow)
Your encryption scheme is to xor
the content with a key the user entered.
To decrypt the content, you'd have to reverse the encryption, which in this case is just xor
ing the content with the key again.
Some other helpful advice:
Indent your code, it'll go a long way towards making it readable
Name your variables better.
ptr1
could beencryptionTarget
,clearText
, orf_pdfFile