Test textPieces based extraction
StringBuffer textBuf = new StringBuffer();
Iterator textPieces = doc.getTextTable().getTextPieces().iterator();
while (textPieces.hasNext()) {
TextPiece piece = (TextPiece) textPieces.next();
String encoding = "Cp1252";
if (piece.usesUnicode()) {
encoding = "UTF-16LE";
}
String text = new String(piece.getRawBytes(), encoding);
textBuf.append(text);
}
StringBuffer exp = new StringBuffer();
for(int i=0; i<p_text.length; i++) {
exp.append(p_text[i]);
}
assertEquals(exp.toString(), textBuf.toString());