Click here to Skip to main content
15,886,024 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
At present, my code can access a .pdf file and read a few properties.
Question:
How is it possible to extend my c# code so that I can read the text inside txtLastname control which is on the second page of the .pdf file?
Thanks

Existing code:
C#
PdfReader reader = new PdfReader(@"D:\test.pdf");
            // total number of pages
            int n = reader.NumberOfPages;
            // size of the first page
            Rectangle psize = reader.GetPageSize(1);

            // file properties
            Dictionary<string, string> infodict = reader.Info;
            foreach (KeyValuePair<string, string> kvp in infodict)
                Console.WriteLine(kvp.Key + " => " + kvp.Value);
Posted
Updated 11-Oct-12 8:10am
v2

Are you looking for something like in this article: A PDF Forms Parser[^]? Or maybe one of these will help you:
http://stackoverflow.com/questions/2550796/reading-pdf-content-with-itextsharp-dll-in-vb-net-or-c-sharp[^]
http://forums.asp.net/t/1218513.aspx[^]

Regards,

Manfred
 
Share this answer
 
Comments
arkiboys 6-Mar-12 6:41am    
Hi, thanks for the code but it just reads the text printed in the .pdf form.
But I am interested to get the text inside the controls. For example, there is a txtcontrol called "txtLastname" inside page 2 where the user has entered his name in it. I would like to retrieve the person's name. How is this done please? Thanks
See my previous answer[^] for similar question.
 
Share this answer
 

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