Hi
I am trying to parse the contents of the PDF with iTextSharp using :
PdfReader reader = new PdfReader("Test.pdf");
reader.GetPageContent(pageNumber);
byte[] pageContentByteArray;
I am using this byte array to search for a partcular text based on a Delimiter pattern by converting this to string by using -
string test = Encoding.ASCII.GetString(pageContentByteArray);
The required text pattern can be matched inside this string.
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
string test = Encoding.ASCII.GetString(invoicePageContentByteArray);
string test = Encoding.Unicode.GetString(invoicePageContentByteArray);
string test = Encoding.UTF8.GetString(invoicePageContentByteArray);
I could not find the text pattern in the output string. I guess the PDF generated out of crystal reports is using some other encoding format.
(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