Refining PDF detection