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

  • Question

  • 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


    • Moved by Fei Hu Thursday, March 22, 2018 8:10 AM Moved From C#
    Wednesday, March 21, 2018 3:44 PM

Answers

  • Hi Sudhakar,

    The iTextSharp library is more related to third party library, You could post a new thread to iTextSharp forum for better support.

    If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 22, 2018 8:09 AM

All replies

  • is this a file on your citrixserver because that is where the program is running?

    Directory_Path + "\\" + selectedFileName


    Success
    Cor


    Wednesday, March 21, 2018 4:11 PM
  • Hi Sudhakar,

    The iTextSharp library is more related to third party library, You could post a new thread to iTextSharp forum for better support.

    If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 22, 2018 8:09 AM
  • @Fei, 

    For your knowledge. If something is running on a local desktop but not on Citrix then the problem is not the classes used in the program. 

    It is the difference between normal desktop and Citrix. 


    Success
    Cor


    Thursday, March 22, 2018 10:51 AM