Thanks for providing us with additional information.
In regards to what might have caused her leg problems, I would have to agree with you that it's injury-related due to the sudden onset.
This is nothing uncommon in ducks, especially with heavier weight breeds like Pekins. While ducks are good swimmers, they are poor walkers on land, and often easily trip, and injure themselves getting minor strains, or soft tissue damage to their legs.
Ultimately, rest will be the best medicine here. That does not mean locking her away in a small pen, but you'll want to keep her in a soft padded area, that reduces her movement. A few times a day I would suggest letting her swim in cool water, possibly with Epsom salts added. If you add Epsom salts, discourage her from drinking the water as it has laxative effects. This whole process will help reduce any swelling going on, and will relieve the weight off her legs, but at the same time letting her exercise them.
In addition to that, I would suggest starting her on B vitamins, specifically niacin (B3) which is an important vitamin in ducks to support healthy leg growth, and structure. What we use most often here is Cattle B Complex Injectable, simply take 1ml out, and sprinkle it over her favorite treats, or give it orally once a day. Link below regarding how to give birds medication orally,
Give her a week or two of supportive care and she should start feeling better soon. Keep us posted on her condition.