half-baked extract function for pdf text