Extensive reformatting of PDF