locked
Arabic Prolem In Filling PDF Form for experts RRS feed

  • Question

  • User1197542501 posted

    Hi all , I hope you are all fine

    I want to fill PDF form from asp.net page data , I used  ASPPDFLib (asppdf library) and I success to passing parameter to pdf form in case I wrote in english.

    When I write in arabic , the word is reverse .

    I tried to create array contain reverse word and reverse it again , It work but the letters not connected together,

    Can any one help me??? I am very desperate

    thanks

     

    thecode I use :

     

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // to keep sessionID (used for file name generation) from changing every time
            Session["dummy"] = 1;
        }
    
        
        private string res(string x)
        {
            //return x;
    
            char[] arr = x.ToCharArray();
            Array.Reverse(arr);
    
            string y = Convert.ToString(arr);
            y = new string(arr);
    
            return y;
        }
    
        protected void Button1_Click(object sender, EventArgs e)
        {
    
            // create instance of the PDF manager
            IPdfManager objPDF;
            objPDF = new PdfManager();
    
            // Create new document
            IPdfDocument objDoc = objPDF.OpenDocument(Server.MapPath("33.pdf"), Missing.Value);
            
            // Arial font supports Latin, Greek, Cyrillic, Hebrew and Arabic
            IPdfFont objFont = objDoc.Fonts["Arial", Missing.Value]; // a standard font
            IPdfAnnot objField;
         
            //////////////////////////////////////////////////
            String strText = TextBox1.Text;
    
    
            
            ////////////////////////////////////////////////
          
            // Set First Name objField = objDoc.Form.FindField("f1-1");
            objField = objDoc.Form.FindField("eqama");
            objField.SetFieldValue(res(strText), objFont);
            //cell.setRunDirection;
    
     
            // We use Session ID for file names.
            // false means "do not overwrite"
            // The method returns generated file name.
            String strPath = Server.MapPath("files") + "\\" + Session.SessionID + ".pdf";
            String strFileName = objDoc.Save(strPath, false);
            lblResult.Text = "Success. Your PDF file <font color=gray>" + strFileName + "</font> can be downloaded <A TARGET=\"_new\" HREF=\"files/" + strFileName + "\"><B>here</B></A>.";
    
    
        }
        protected void TextBox2_TextChanged(object sender, EventArgs e)
        {
    
        }
    
    
    }


     

     

    Monday, January 10, 2011 4:24 AM

All replies

  • User1654853431 posted

    This problem is solved in crystal by setting the field type to rich text , try finding something similiar in your component.

    Wednesday, January 12, 2011 2:20 AM