President Obama has often been compared, with some justification, to a fic tional self-made man — Kosinski’s Chance the Gardener, Fitzgerald’s Jay Gatsby — but after this week’s tax deal and the outraged reaction to it (including by Obama himself), perhaps the most apt comparison is with Daniel Dravot in Kipling’s “The Man Who Would Be King.”

Dravot, you may recall, is an intrepid British soldier of fortune who, along with his friend Peachey Carnehan, conquers Kafiristan in the Hindu Kush and is hailed as a god-king. But his luck runs out when he takes a wife and tries to kiss her; the girl bites his lip and he bleeds. Dravot is sacrificed by the outraged natives, and Peachey tortured — because gods do not bleed.

The president ought to read that story, if only as a cautionary tale of ambition, overreach and what happens when the unrealistic expectations of true believers are dashed.

Obama has famously characterized himself as a blank canvas, onto which other people can project their hopes, dreams and aspirations, and it was in fact a blank canvas who took the oath of office in 2009 — a man nearly unknown just a few years before, whose past he himself had mythologized in “Dreams From My Father.”

Since that triumphant moment, the canvas has been gradually filled in: the excessive, indeed comical, use of the teleprompter; the overweening ego of a born apple-polisher; the bristling at the slightest setback, as if all politics were not only local, but personal.

The figure who stood before the faux Roman columns in Denver and proclaimed “this election has never been about me” is now the punch line to a particularly enraged Keith Olbermann “special comment.”

Which is why the ferocious reaction to this week’s tax deal is such poetic justice. Ever since the election, the meme has been building on the left that the once-glorious emperor isn’t tough enough, that he has squandered his steamroller majorities in both houses of Congress and all he has to show for it is the electoral albatross of ObamaCare.

Anger has been growing — anger over what might have been (in the Democrats’ telling), had Obama ruthlessly hunted down those he frankly characterized as “enemies” and destroyed the legacy of the hated George W. Bush, rather than continuing it in such matters as Guantanamo, the wars in Iraq and Afghanistan and, now, the prolongation of the Bush tax structure.

The right saw him differently. To them, Obama was every inch the ruthless Chicago machine pol, a credentialed matchstick of modest personal accomplishment manipulated with ease by the unholy spawn of ’30s gangsters and ’60s Marxists that control the Democratic Party: a kind of latter-day Warren G. Harding.

Ever the teacher’s pet, Obama is now trying to have it both ways. He is defending his Runnymeade capitulation to the Republican barons (whose resolute refusal to accept his alleged olive branch of “bipartisanship” has won them at least a partial victory), while simultaneously denouncing GOP “hostage takers” for having called his bluff and forced his hand.

This leaves “progressive” Democrats like Olbermann and Katrina van den Heuvel in a state of rage unseen since . . . well, since Bush was president. Only this time, they’re not enjoying it.

So which is the real Obama? Conquering avenger or hapless stooge?

A man who has never been tested, who’s never had a door slammed in his face, who’s never been told to take a hike, who’s won every fixed fight he’s been in, is getting his first taste of adversity. How he deals with it, whether masterfully or petulantly, will tell us a great deal — not only about Barack Obama, but who will be the president come 2013.

Michael Walsh is the author of the thrillers “Hostile Intent” and “Early Warning” and, writing as David Kahane, “Rules for Radi cal Conservatives.”