Other giants from the world of literature who will be at the event include Louis de Bernieres, Germaine Greer, former foreign secretary Lord Hurd, Ian Rankin, Iain Banks and Terry Pratchett.
The festival is expected to attract more than 120,000 visitors to Charlotte Square Gardens between 10 and 27 August.
Director Catherine Lockerbie said the event was "the biggest, most popular and most dynamic celebration of the written word in the world".
Pinter - regarded by many as Britain's greatest living playwright - is believed to be making his first public engagement since he was diagnosed with cancer of the oesophagus in February this year.
Irish writer and Nobel prize winner Heaney will read from his new English translation of Gaelic poem Hallaig, while Welsh will read from his latest novel Porno, the sequel to Trainspotting.
War fascination
And Doyle will preview his new short story about the Rabbit family - first made famous in his Barrytown trilogy.
Historians David Starkey and Stalingrad author Anthony Beevor will discuss our increasing fascination with books about the war.
The festival will attract its biggest attendance yet from North American writers who are to discuss the impact of the terrorist attacks on 11 September on US literature.
And there will be a series of debates on the future of the monarchy, animal experimentation, designer babies, education and religion.
Some 9,000 children are expected to join in the fun programme for young readers, which include storytelling and illustration.
The organisers said the festival was bucking the trend for arts sponsorship as they announced a record level of corporate funding.
Recent reports have pointed to a 25% drop in business support for the arts but the sponsorship for the book festival has doubled over the past two years, Ms Lockerbie said.