Adjust paper size depending on boxes