Jim Halpert, partner and corporate attorney at DLA Piper, is the real-life namesake of the character on NBC hit show, “The Office.” (Evy Mages/For The Washington Post)

The office of the real Jim Halpert is 250 miles south of Scranton, Pa., and it does not sell paper.

Halpert, 51, is a corporate attorney in the D.C. office of global law firm DLA Piper and, as co-chair of the firm’s data protection practice, advises companies on how to comply with privacy laws.

He is also the real-life namesake of Jim Halpert, the charming-but-unmotivated prankster from the former NBC hit “The Office,” now in syndication.

Halpert has been friends with show writer Greg Daniels since before kindergarten. The two grew up together in New York City, stayed friends through college (Daniels at Harvard, Halpert at Yale) and continued to stay in touch as they progressed in their respective careers. They socialized frequently in the late 1980s, when Daniels was a writer for “Saturday Night Live” and Halpert was clerking for a federal judge in New Jersey.

Daniels has since found success writing for “King of the Hill,” “The Simpsons” and “Parks and Recreation,” while Halpert has carved out a career in corporate law, with a focus on privacy, cybersecurity and digital copyright.

Actors in “The Office” included John Krasinski as Jim Halpert, Rainn Wilson as Dwight Schrute and Steve Carell as Michael Scott. (Trae Patton/ NBC Universal)

These days, they periodically vacation together with their wives and children. They celebrated their 50th birthdays together last year. In 2012, Daniels invited Halpert, his wife, Karen, and their children, Sam and Daniel, to tour the set of show before the final season wrapped. They got to meet the actors, and were greeted with a sign that read, “’The Office’ welcomes the real-life Jim Halpert.”

Halpert is not the only one with an Office character named after him — his and Daniels’s mutual friend since second grade, Andy Bernard, is a professor at the Tuck School of Business at Dartmouth.

Below is an edited excerpt of Halpert’s interview with Capital Business.

Are you anything like on-screen Jim?

The Jim character in the beginning has a Gen-Y lack of career direction. I was not like that. I didn’t know what I wanted to do, but I wasn’t a slacker at the job. Jim has basic common sense in terms of human relationships and has an emotional intelligence that I’d like to think I have ... I spend my time heading our cybersecurity and privacy initiatives as global co-chair of both those practices. Nothing at all like Jim, no. Most Americans would not identify with my career path. But I’m very much in an office. I have a sense of humor. But I don’t play pranks, and I’m not as tall or good looking.

Did you have any reservations about having a character named after you?

In the BBC series, none of the characters are particularly sympathetic. So when Greg told me he named a character after me, I had visions of being the David Brent [Ricky Gervais] character, and I said, “You did what?!” He said, “I think you’ll like it.” It was a very nice present, actually. It was a lot of fun to follow the show and have a personal connection with it.

Do you have a favorite episode?

My favorite episode remains the third episode [“Health Care”]. Part of it is because I’m a privacy lawyer, so I think it’s really funny. Dwight is relegated to find a new health plan, a cheaper rock-bottom basement health plan. The plan is so bad that the employees revolt, so Dwight decides that instead, he’s going to have people opt into coverage for specific medical conditions. He gets everyone together and asks, “What do you want covered?” Every person started submitting these conditions on pieces of paper, they were all disgusting, and some were jokes that Jim and Pam have written. There is one, anal fissures, and Dwight says, “That must be a joke.” And Kevin says, “Um.”

Does anyone ever do a double-take when you introduce yourself?

Less so now that the show is in syndication but yeah, absolutely. They say, “That name sounds really familiar.”