It is possible to buy the DDE at the park provided that it is a weekday. If you get a really cooperative CM, they can process a temporary in 24 hours.
However, that is a bit of a hassle and there is no promise that they will do it. It also means that it cannot happen on a Fri, Sat, or SUnday.
The above suggestion is a good one--advance order your AP, and call to order the DDE about 2 weeks before you go. The web site says it takes 2 weeks to process although the CM I spoke with said it would take 6 weeks. It actually took 16 days for my DDE to arrive in the mail (last mail before our trip), but they did say that they would send the temporary to Epcot Guest Services in case I didn't get it.
Your AP won't start until you go to Guest Services to activate it....so you could go to Epcot and accomplish both things when you arrive. Yes, with this suggestion your DDE will run out 2 weeks before your AP, but you will have the security of having it in hand. Also, I just looked at my DDE card. It expires at the end of the month in which I bought it. I know that the expiration date listed is NOT the purchase date. Maybe they allowed me until the end of the month to allow for the processing time???