Any change you make the result is the same Wolfram file: pdf file:
I used these settings but these spaces still remain.
Have a look at Option Inspector > Cell Options > Page Breaking. You may have to change the settings for those cells that cause those empty spaces.
Option Inspector > Cell Options > Page Breaking
In the notebook menu item Printing Settings you can adjust page margins. As well as page size and orientation.