I would like to take an annotated pgn file, and convert it into an ebook I could conveniently read on amazon kindle (or its pc version), or android/Ios device. It might have to create diagrams where needed and make the book easy to go through without an extra chessboard. It would be good if the output format allowed to upload it to amazon store as well. Does such software/tool exist?
You can export to html/web with most if not all of the major chess database programs (Chessbase, Chess Assistant, SCID). The problem is compiling the html pages into pdf/epub, as the formatting is usually not well-preserved for such conversions, but the book should remain readable with the diagrams. The converters are widely-available however, like Calibre (although I have not used that to convert ebooks specifically, but for managing my book collection)
This may or may not be your cup of tea, but if you are a LaTeX user, then SCID's LaTeX export feature produces ready-to-compile LaTeX source that yields rather nice (IMO) PDFs quickly and painlessly. There are a few options regarding how/whether comments and variations are to be displayed, and diagrams are automatically included wherever you have inserted a diagram NAG
D into the game score (which can be inserted the same way that move annotations like
!? are when using SCID). Here's a cropped screen grab from the PDF output of a fake sample game:
The Chessbase 12 and 13 manuals say that they can export games in epub or mobi format, but you would need to go through the game, and insert the diagram symbols first.
You can read pgn files as is on iOS/Android. For iOS, Giordano Vicoli's Chess Studio Light and Chess_Studio can read, and play through annotated pgn files. On Android, Chess PGN Master Pro can read and play through annotated pgn files. Everyman chess sells pgn versions of its books through its iOS/Android Chess Viewer apps.