Print Page | Close Window

URGENT : Help with parsing the PDF generated by Cr

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4646
Printed Date: 19 May 2024 at 6:43pm


Topic: URGENT : Help with parsing the PDF generated by Cr
Posted By: uxpalan
Subject: URGENT : Help with parsing the PDF generated by Cr
Date Posted: 28 Oct 2008 at 11:59am

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




Print Page | Close Window