Further explanation on graphing in R:
When you call boxplot() (or any graphing function) in R, it draws it in a default graphic device, which it closes after you're done. Every time you call another boxplot() function, it overwrites your previous plot. What Sam suggests above is opening your own graphics device manually (in this case, a pdf), write what output you want to it, and then close it.
A couple of things to keep in mind: be sure to close the graphic device explicitly with dev.off(), and be careful with using loops to write files, since if your loop is incorrect and turns out to be an infinite loop, you will create a huge file and potentially cause issues.