I am trying to parse the contents of the PDF with iTextSharp using :
Expand|Select|Wrap|Line Numbers
- PdfReader reader = new PdfReader("Test.pdf");
- reader.GetPageContent(pageNumber);
- byte[] pageContentByteArray;
Expand|Select|Wrap|Line Numbers
- string test = Encoding.ASCII.GetString(pageContentByteArray);
The above logic works absolutely fine if we use a normal PDF input file.
My requirement is to read a PDF file which is created by CRYSTAL REPORTS (Version-9).
I have a byte array with me. But I tried to convert to string using ASCII, UNICODE , UTF8
Expand|Select|Wrap|Line Numbers
- string test = Encoding.ASCII.GetString(invoicePageContentByteArray);
- string test = Encoding.Unicode.GetString(invoicePageContentByteArray);
- string test = Encoding.UTF8.GetString(invoicePageContentByteArray);
(Note : We verified the template used by crystal reports to generate the PDF. The search delimiter pattern is defined as the Text object)
Can anyone suggest ideas to resolve the above problem.
Thanks,
Uma