flushing on newline forces pdf->txt to behave
a couple of bugs fixed