151a152,180
>     
> 	 /**
>      * This will return the text of a document until the line specified by the user.  
>      * See writeText. <br />
>      * NOTE: The document must not be encrypted when coming into this method.
>      *
>      * @param doc The document to get the text from.
>      *
>      * @param text Text specified by the user from the pdf.
>      *
>      * @return The text of the PDF document.
>      *
>      * @throws IOException if the doc state is invalid or it is encrypted.
>      */
>     public String getTextTillLine( PDDocument doc, String text ) throws IOException
>     {
>         StringWriter outputStream = new StringWriter();	
>         writeText( doc, outputStream );
>         String outputString = outputStream.toString();	
>         int startIndex = outputString.indexOf(text);
>         if (startIndex != -1)	
>         {
>         	return outputString.substring(0,startIndex);
>         }		
>         else
>         {
>         	return null;
>         }
>     }
