While I do agree with this philosophy, I can't say I have come up with a good way to do it.
Is there a code in the book? If so, what stops Bob from simply walking into the bookstore and flipping to the page with the code and then getting his free pdf?
Is it based on the barcode? We've already got barcode scanners in cell-phones. There are plenty of other ways to abuse this too, especially by store employees.
Something on the receipt maybe? Why not buy and return? How would DungeonScape know?
It could work like Pathfinder, but you'd be limited to buying ONLY from WotC, and while that works for some companies, that's clearly not their business strategy.
Honestly, short of making a nearly $50 book even more accessible than the MSRP already makes it, I don't see a good way to get a free PDF with purchase.