Hi,

I have a problem when trying to convert a simple text file containing Greek 
characters to a pdf file.
To be more specific, when converting this file, the Greek characters as missing 
from resulting pdf, even though I try to use a specific encoding.

This is my code:

'Create PdfWriter

  PdfWriter.GetInstance(doc, New 
FileStream(OpenFileDialog1.FileName.Substring(0, 
OpenFileDialog1.FileName.LastIndexOf("\")) + 
_
                                      "\1.pdf", FileMode.Create))
  doc.SetPageSize(iTextSharp.text.PageSize.A4_LANDSCAPE.Rotate)
  doc.SetMargins(1, 1, 1, 
1)
  doc.Open()
  


'Create file
DimbfTimes AsBaseFont= BaseFont.CreateFont(BaseFont.HELVETICA, 
BaseFont.WINANSI, BaseFont.EMBEDDED)
Dim times As Font = New Font(bfTimes, 10)
Dim sr As StreamReader = New StreamReader(OpenFileDialog1.FileName, 
Encoding.GetEncoding(1253))
            Try
            Dim line As String
            Do
                line = sr.ReadLine()
                doc.Add(New Paragraph(line, times))
            Loop Until line Is Nothing
            sr.Close()
            doc.Close()
        Catch Ex As Exception
            ' Let the user know what went wrong.
            Console.WriteLine("The file could not be read:")
            Console.WriteLine(Ex.Message)
            sr.Close()
            doc.Close()
        End Try
 
I also attach both the initial file and the PDF file just to identify the 
differences.

Is there any solution for this issue?

Thank you.



I 









                    
********************************************************************************************
                    *                                                           
                               *
                    *                                                           
                               *
                    *                      ΚΑΤΑΣΤΗΜΑ     :   278  
ΒΟΝΙΤΣΑΣ                                     *
                    *                                                           
                               *
                    *                      ΕΚΤΥΠΩΣΗ      :   AXMH 
LPXMDR02(AXMH)                               *
                    *                                                           
                               *
                    *                      ΗΜΕΡΟΜΗΝΙΑ    :   
31-10-2008                                        *
                    *                                                           
                               *
                    *                      ΑΡ. ΠΡΩΤΟΚΟΛΛΟΥ  :     
5561182                                      *
                    *                                                           
                               *
                    *                                                           
                               *
                    
********************************************************************************************













































ΑLΡΗΑ ΒΑΝΚ Α.Ε.        ΚΑΤΑΣΤΗΜΑ  278  ΒΟΝΙΤΣΗΣ      
                                               LΡΧΜDR02  06/11/2008 
ΣΕΛΙΔΑ 7596
ΑΝΑΛΥΤΙΚΟ ΚΑΘΟΛΙΚΟ  ΛΟΓΑΡΙΑΣΜΩΝ  ΜΗΝΟΣ  
10.2008.   00  ΕUR



                                                  ΣΥΝΟΛΟ                  
    242,71               100,00             44.556,13Χ

Attachment: 1.pdf
Description: Adobe PDF document

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to