Not long ago, an aspiring book writer rejected by traditional publishing houses had only one alternative: vanity publishing. For $5,000 or $10,000, or sometimes much more, he could have his manuscript edited and published, provided that he agreed to buy many copies himself, often a few thousand or more. They typically ended up in the garage.

Digital technology has changed all that. A writer turned down by traditional publishers — or even avoiding them — now has a range of options. Among them are self-publishing a manuscript as an e-book; self-publishing through myriad companies that print on demand, in which a paperback or hardcover book is printed each time it is purchased; and buying an array of services, from editing and design to marketing and publicity, from what are known as assisted self-publishing companies.

“It’s the Wild West in a lot of ways — people who are innovators can do remarkable things,” said Mark Levine, whose own self-published book, “The Fine Print of Self-Publishing,” is now in its fourth edition.

Digital publishing and print on demand have significantly reduced the cost of producing a book. The phenomenal growth of e-readers and tablets has vastly expanded the market for e-books, which can be self-published at little or no cost. Writers who self-publish are more likely to be able to control the rights to their books, set their books’ sale price and keep a larger proportion of the sales.