Crystal Reports is one of the WORST PDF creation tools on the market. It generates REALLY BAD PDF.

Leonard

On Dec 14, 2007, at 8:25 AM, Artur Muradyan wrote:

Hi iText team,



I have a pdf file (“01.pdf”) which created by Crystal Report. The Acrobat Pro 7 shows it correct. Please see “Pdf file Fonts.JPG” and “Pdf file Description.JPG” screenshots for more details.



The following C# code shows the extracted text (the attached “Extracted Text.JPG” file):



  PdfReader pdfReader = new PdfReader(@"C:\Temp\01.pdf");

  PRTokeniser token;

  StringBuilder builder = new StringBuilder();

  byte[] pageBytes = pdfReader.GetPageContent(1);



  if (pageBytes != null)

  {

      token = new PRTokeniser(pageBytes);



      while (token.NextToken())

      {

          if (token.TokenType == PRTokeniser.TK_STRING)

          {

              builder.Append(token.StringValue);

          }

      }

  }



  MessageBox.Show(builder.ToString());



Of course, the same code correctly extracts from pdf files which are not created by Crystal Report.



I noticed that Acrobat does not save the pdf file as RTF or plain text, I receive the attached “Acrobat Error.JPG” error message.

So can I extract the text with correct encoding from such pdf file using iTextsharp?



Thanks in advance,

Artur Muradyan



<Extracted Text.JPG><Acrobat Error.JPG><Pdf file Fonts.JPG><Pdf file Description.JPG> ---------------------------------------------------------------------- ---
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/ marketplace_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to