JOHN GRISHAM, a prolific author of legal thrillers, long refused to allow his books to be sold in electronic form. In a television interview last year, he lamented that e-books and heavy discounting of printed books by big retailers were “a disaster in the long term” for the publishing industry. But last month Mr Grisham's publisher announced that the author had had a change of heart: henceforth all of his books will be available in virtual form. His timing was impeccable. On April 3rd Apple is due to start shipping the first of its iPad tablet computers, which are expected to give a big boost to e-book sales.

The iPad's impending arrival has created commercial intrigue worthy of a Grisham yarn. A group of big publishers, including Macmillan and HarperCollins, have been using Apple's interest in e-books to persuade Amazon, which currently dominates sales of digital books, to renegotiate its pricing model. At one point in January an angry Amazon briefly removed many of Macmillan's books from its own virtual shelves before reinstating them after some authors kicked up a fuss.

Like many other parts of the media industry, publishing is being radically reshaped by the growth of the internet. Online retailers are already among the biggest distributors of books. Now e-books threaten to undermine sales of the old-fashioned kind. In response, publishers are trying to shore up their conventional business while preparing for a future in which e-books will represent a much bigger chunk of sales.

Quite how big is the subject of much debate. PricewaterhouseCoopers, a consultancy, reckons e-books will represent about 6% of consumer book sales in North America by 2013, up from 1.5% last year (see chart). Carolyn Reidy, the boss of Simon & Schuster, another big publisher, thinks they could account for 25% of the industry's sales in America within three to five years. She may well be right if the iPad and other tablet computers take off, the prices of dedicated e-readers such as Amazon's Kindle keep falling and more consumers start reading books on smart-phones. Mobclix, an advertising outfit, reckons the number of programmes, or apps, for books on Apple's iPhone recently surpassed that for games, previously the largest category.

Alert to such shifts, publishers are trying to undo a mess that is largely of their own making. For some time they have operated a “wholesale” pricing model with Amazon under which the online retailer pays publishers for books and then decides what it charges the public for them. This has enabled it to set the price of many new e-book titles and bestsellers at $9.99, which is often less than it has paid for them. Amazon has kept prices low in order to boost demand for its Kindle, which dominates the e-reader market but faces stiff competition from Sony and others.

Publishers fret that this has conditioned consumers to expect lower prices for all kinds of books. And they worry that the downward spiral will further erode their already thin margins—some have had to close imprints and lay off staff in recent years—as well as bring further dismay to struggling bricks-and-mortar booksellers (see article). Unless things change, some in the industry predict that publishers will suffer a similar fate to that of music companies, whose fortunes faded when Apple turned the industry upside down by selling individual songs cheaply online.

Ironically, publishers have turned to Apple to help them twist Amazon's arm. Keen to line up lots of titles for new iPad owners, the company has agreed to an “agency model” under which publishers get to set the price at which their e-books are sold, with Apple taking 30% of the revenue generated. Faced with these deals, Amazon has reportedly agreed similar terms with several big publishers. As a result, the price of some popular e-books is expected to rise to $12.99 or $14.99.

Once Apple and Amazon have taken their cut, publishers are likely to make less money on e-books under this new arrangement than under the wholesale one—a price they seem willing to pay in order to limit Amazon's influence and bolster print sales. Yet there are good reasons to doubt whether this and other strategies, such as delaying the release of electronic versions of new books for several months after the print launch, will halt the creeping commoditisation of books.

Apple, for instance, is rumoured to have kept the option of charging much less for popular e-books if they are being heavily discounted elsewhere. Other firms, including the mighty Google, are likely to enter the fray soon, which will only increase the competitive pressure.

This is particularly alarming for publishers because digital margins are almost as slender as print ones. True, e-books do not need to be printed and shipped to retailers. But these costs typically represent only a tenth of a printed book's retail price, estimates Credit Suisse, an investment bank. Meanwhile, as David Young, the boss of Hachette Book Group, points out, publishers are incurring new costs in the form of investment in systems to store and distribute digital texts, as well as to protect them from piracy.

Publishers are investing in the internet in other ways too. A few are starting to build their own online groups of readers. For instance Tor.com, a publisher-run website for science-fiction and fantasy enthusiasts, highlights content relevant to its members, even if some of it comes from rival publishers. “This is a rare sign that the light's finally gone on in publishing,” says Mike Shatzkin of Idea Logical, a consultancy. Sourcebooks, a medium-sized publisher that has developed an online group focused on poetry, found that sales of its books rose by more than 50% in the six weeks after poems from them had featured on the site.

Publishers are also pumping plenty of money into what Hachette's Mr Young calls “enriched e-books”, which combine the printed word with audio, video and other media to create content that can command a premium price. The launch of the iPad will speed up this experimentation, but it is not the only device to catch publishers' attention. HarperCollins, for instance, has sold hundreds of thousands of cartridges in Britain that let users read electronic versions of classic texts on Nintendo DS portable game consoles. Charlie Redmayne, the “chief digital officer” of one of its units, reckons many of the buyers would not have splashed out on print editions, so the move to a new platform has created fresh demand for books.

Indeed, many publishing executives like to argue that the digital revolution could usher in a golden age of reading in which many more people will be exposed to digital texts. They also point out that new technologies such as print on demand, which makes printing short runs of physical books more economical, should help them squeeze more money out of the old-fashioned format. And they insist that the shift away from printed books will be slow, giving them more time to adapt to the brave new digital world.

Perhaps. But there are still plenty of inefficiencies in the supply chain for conventional books that firms such as Amazon and Apple can exploit. Many publishers, for example, still take far too long to get books to market in print or electronic form, missing valuable opportunities. Ms Reidy at Simon & Schuster says she has brought functions such as typesetting in-house to boost efficiency. At Sourcebooks responsibility for making books has even been shifted from the editorial team to the firm's head of technology, underlining the need to think digitally right from the start of the commissioning process.

The publishing firms that survive what promises to be a wrenching transition will be those whose bosses and employees can learn quickly to think like multimedia impresarios rather than purveyors of perfect prose. Not all of them will be able to turn that particular page successfully.