Not able to read the text from PDF file only in Citrix server using C#

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Not able to read the text from PDF file only in Citrix server using C#

Sudhakar Chitlam
Hi All,

I am not able to read the text from PDF file only in Citrix server. But its working fine in local desktop.

I wrote the below code for taking the text from PDF file.


using (PdfReader reader = new PdfReader(Directory_Path + "\\" + selectedFileName))
                        {
                            int Total_Pages = reader.NumberOfPages;

                            for (int i = 1; i <= reader.NumberOfPages; i++)
                            {
                                StringBuilder text = new StringBuilder();
                                ITextExtractionStrategy Strategy = new iTextSharp.text.pdf.parser.LocationTextExtractionStrategy();
                                string page = "";
                                page = PdfTextExtractor.GetTextFromPage(reader, i, Strategy);
                                string[] lines = page.Split('\n');


                                foreach (string line in lines)
                                {  
                                    if (line.Contains("Ref.:"))
                                    {}}}


Getting the Index out of Range issue.

Kindly help me out on this.

Regards,

Sudhakar Chitlam