"Wherever possible, we tried not to do unnecessary visual effects shots because, digitally, you can never really re-create an IMAX image," visual effects supervisor Nick Davis said.
Stuntman and goon actor Charles Jarman, who played the fatal character, explained it took 22 takes and several different tables to get the final result.
He said: "I remember Christopher Nolan saying to me, 'Look, we're going to do a couple of shots where you need to be able to take that pencil away'.
"We did a couple of half-speed rehearsals just to get the hand action of my right hand sweeping across, taking the pencil as my body was going down, and my head striking the blank surface."
Graphic Warning:
"It was a little hairy, because the pencil's stuck in the table," Jarman continued.
"If, for some reason, I didn't get my hand in time, we wouldn't be having this conversation. Well, possibly through a Ouija board."
During the 22 takes, Jarman said he was knocked out three times and that the only time that method actor Ledger broke character was when he asked the stuntman if he way okay after being knocked out.
Ledger was just 28 when he passed away from an accidental overdose in 2008, leaving behind a then 2-year-old daughter, Matilda.