Dr. Seuss, creator of some of history’s most quirky and beloved children’s books, was a famously private man. But during one of his most vulnerable periods — while he was being treated for oral cancer in his early 80s — he wrote a book for adults, a memoir-esque saga of an old man in a bowtie being ushered through the medical industrial complex.

The book, which came out in 1986, featured all the caprice and color readers expected from Dr. Seuss, the pen name of Theodor Geisel. Marketed for grown-ups, “You’re Only Old Once!” became a popular gift for people hitting milestones such as 50 or 70.

“It was like, ‘This is what’s coming, kids,’ ” said Cathy Goldsmith, Geisel’s longtime art director at Random House, which is publishing a 30th anniversary edition this summer.

The book’s hero is stripped of his clothes and wheeled down labyrinthine hallways and into labs, where complex machines test every body part. Doctors and medical devices are rendered in acid green, magenta and lemon yellow, with verses written in Geisel’s signature anapestic tetrameter.

Dietician Von Eiffel controls the Wuff-Whiffer,
our Diet-Devising Computerized Sniffer,
on which you just simply lie down in repose
and sniff at good food as it goes past your nose.
From caviar soufflé to caribou roast,
from pemmican patties to terrapin toast,
he’ll find out by Sniff-Scan the foods you like most.
And when that guy finds out
what you like,
you can bet it
won’t be on your diet.
From here on, forget it!

The book pokes fun of the endless testing, and billing, that becomes part of life as one ages. The book ends on an up note, with the old man getting his clothes back and knowing that he is “in pretty good shape, for the shape (he is) in!”

The message was that “you can have some rocky times and things can get a little out of hand, but hang in there and you’ll get through it,” Goldsmith said.

Though he had written an adult book in the 1930s, “The Seven Lady Godivas,” it had sold poorly, and he once told the Washington Post it was “my biggest failure.” After that, he stuck with children’s books. “I think he took what he knew about adults and boiled it down for kids, so to age back up a little bit seems perfectly natural,” Goldsmith said. The new book’s subtitle was “A Book for Obsolete Children.”

It is a project that could easily have never come to pass. The cancer treatment had flattened him, and though he was in remission, he thought his writing days were over.

“He was in huge amounts of pain,” said Judith Morgan, a longtime friend and co-author of a biography called “Dr. Seuss and Mr. Geisel.” It wasn’t until 1985, when he was invited to accept an honorary degree from Princeton, that he revived. When he came forward to accept the degree, the graduating class stood up and chanted, “I am Sam! Sam I am!” and then recited the entire text of “Green Eggs and Ham.”

“It gave him a huge lift, and when he got home he remembered, this was the way it feels to be on a writer’s high,” Morgan said. It was time to write a new book.

He had been sketching the medical machines and gadgets he saw throughout his treatment, so he already had material. “It was self-help and self-defense at the same time,” Morgan said. “He didn’t want to go through the treatment, he wanted to stay home and draw.”

All the doctors in the book are men, although Geisel’s physician was a woman. That was deliberate. “She requested that, no matter how mad he got at doctors, would he please not make fun of women doctors, because she had just gotten her MD in her 50s and it had been a struggle.” He respected her wishes.

Early reviews were not enthusiastic; one reviewer called it “an unexpected lamentation about infirmities,” Morgan said. But Geisel knew his audience. He had been writing for baby boomers since they were babies, and his themes mirrored their life trajectory, from early books about messing up the house and trying out new foods, to later books about environmentalism and nuclear proliferation. By the mid-1980s the boomers were entering middle age, and “You’re Only Old Once!” became a popular gag gift for people turning 40.

“The kids I first wrote for. … are not old poops yet but they have their feet in the door,” he explained at the time. The Book-of-the-Month Club called it a book for “ages 95 and down.”

The happy ending was something Geisel knew was necessary, “because the other ending was not acceptable,” Morgan said. But it turned out to be fictional. His cancer returned, and he died in 1991 at 87.

Although he was not a religious man, he was a spiritual one, she said. “He didn’t fear death.” In fact, among his private papers was a verse, written in the 1930s or 40s when he was still young, called, “I Am Prepared.”

When I cross the Bar of the Great Blue Beyonder
I know that my Maker, without pause or ponder
Will welcome my soul. For my record is scar-less
I’ve eaten no oysters in months that are R-less.