Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Ho to convert encrypted pdf to text?. I have tried itextsharp, but its not decryting the data. But the text is totally readable in Adobe Reader without any extra settings.
Posted

1 solution

This CodeProject article, with comments to it, is an evidence of that fact that people can extract text from PDF even with iTestSharp: Extract Text from PDF in C# (100% .NET)[^].

Please try it, too. Pay attention for the code shown in the post "Alternative solution" (and replies) of the "Comments and Discussions" section.

—SA
 
Share this answer
 
Comments
bidyut12345 15-Feb-13 14:28pm    
Thank you Sergey Alexandrovich,
I have tried your solution, but its not doing the job.

Please check the pdf.
https://docs.google.com/file/d/0B_h880AcMzAtQXpPNkQyaUlSU2M/edit?usp=sharing
Sergey Alexandrovich Kryukov 15-Feb-13 14:32pm    
Do you understand that you asked for pure text, which means that the structure (such as alignment) it totally lost? Did you get any text at all?
—SA
bidyut12345 15-Feb-13 14:36pm    
Yes, sir.
I just want all the text to read it.
But when i extract it using itextsharp it gives me (Page 1 last lines)

--------------------------------------------------------------------

For Disclosure, Privacy Act, and Paperwork Reduction Act Notice, see separate instructions.

Form 1040A (2012)




     
     
     
- / 2 ! , % 3
  
 
   

   3  %  3 4 2 % % 4

/ 3 # ! 2 5 2 ) % ,
2 / 1 5 % - / 2 ! , % 3
  
 
    3 O N

- ) !
2 % 3 % . $ ) : - / 2 ! , % 3
  
 
    $ A U G H T E R

- ! 2 # / ! . 4 / . ) !
2 % 3 % . $ ) :
0 2 5 $ % . 4 %
  
 
    / T H E R
! $ ) , % . %
3 ! . 4 ! 2 / 3 ! # !     
BAA
REV 01/28/13 TTW
--------------------------------------------------------------------

So, i need it in original format.
bidyut12345 15-Feb-13 14:37pm    
And with your solution i was unable to find these lines in the result. (Not present in the resultant text)
bidyut12345 15-Feb-13 14:39pm    
The result should be like this
------------------------------------------------------------
For Disclosure, Privacy Act, and Paperwork Reduction Act Notice, see separate instructions. Form 1040A (2012)
1
2
4
15,707.
15,707.
15,707.
MORALES 960-87-5148
446 S.E. STREET
1
OSCAR URIEL ROQUE MORALES 606-29-9849 Son
MIA RESENDIZ MORALES 606-67-5422 Daughter
MARCO ANTONIA RESENDIZ-PRUDENTE 975-75-6511 Other
ADILENE
SANTA ROSA CA 95404
BAA
REV 01/28/13 TTW
------------------------------------------------------------

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900