automatic pdf extraction