Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2500

Apache Tika do not extract first line of the RTF file, It only extract last three char of first line.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.16
    • 1.22
    • None

    Description

      When I am parsing the RTF file, it only prints last three characters of the first line.Remaining lines are printed properly.

      Following is the RTF file text. Please copy the text and save as RTF format.

      {\rtf1\ansi\ansicpg1252\uc1\deff0 {\rtf1\ansi\deff0 {\fonttbl{\f0 Arial;}}\f0 {\line

      {\b Level1}

      : \par}

      {\line This is level1 paragraph\line This is level1 paragraph\line This is level1 paragraph\line This is level1 paragraph\line This is level1 paragraph\line This is level1 paragraph\par}

      {\line

      {\b Level2}

      : \par} This is level2 paragraph.\line This is level2 paragraph.\line This is level2 paragraph.\par} } \line \par}

      When you save this text as RTF file it will look like this.

      https://i.stack.imgur.com/p1rWe.png

      I have parsed above RTF from the following code.

      
      BodyContentHandler handler = new BodyContentHandler();
      Metadata metadata = new Metadata();
      FileInputStream inputstream = new FileInputStream(new File("level1Missing.rtf"));
      ParseContext pcontext = new ParseContext();
      RTFParser rt = new RTFParser();
      rt.parse(inputstream, handler, metadata, pcontext);
      //getting the content of the document
      System.out.println("Contents of the PDF :\n\n" + handler.toString());
      

      The output of the above code is following.

      https://i.stack.imgur.com/cJYuQ.png

      Attachments

        Issue Links

          Activity

            People

              tallison Tim Allison
              rshelhalkar Rohit Sureshrao Shelhalkar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: