final String lineSeparator, final String pageSeparator)
{
final StringWriter output = new StringWriter();
try
{
final PDFTextStripper textStripper = new PDFTextStripper();
textStripper.setPageSeparator(pageSeparator);
textStripper.setLineSeparator(lineSeparator);
textStripper.setStartPage(startPage);
textStripper.setEndPage(endPage);
textStripper.writeText(getPDFDocument(), output);
return output.toString();
}
catch (final Exception e)
{
throw new RuntimeException("Error while extracting text from document.", e);