There really isn't any any other option. The CHM author has gone through and marked all code sections in pre tags. That's what you need to do with the PDF output to make it look right on your Kindle.
Due to how PDF's are made there is no good / easy way to detect and add pre tags when converting. PDF files don't even differentiate paragraphs. It's all fixed with lines. There has been many hours of work put into calibre's PDF conversion to determine which lines belong in the previous or a new paragraph.
|