Optimized print area detection