Depends on the country. In Holland this was about up until WWII. After that in Catholic areas. My dad was born after the war and from a family of 7.
In other countries it continued even longer.
What does on demand mean exactly? Where they coerced?
Yes. By society (married women had to give up their government jobs until into the 60s!) and by the church. After a couple had their last kid about a year ago they'd get a visit from the priest to remind them there was still more 'work' to be done..