How does the peg limit the printing?
Say, for example, we peg the dollar to gold at the current price of $1,900/oz.
If you try to print money at a rate that would inflate the dollar, people can go to the treasury and demand that it turn over gold in exchange for $1,900 in currency. This acts as a disincentive to causing inflation.