Example #1
0
        void ReadMobiFile(MobiHeaderReader mobiReader, PdbRecords pdbRecords)
        {
            string title = mobiReader.GetTitleReader().ReadTitle();

            ExthHeaderReader exthReader = mobiReader.GetExthHeaderReader();

            if (exthReader == null)
            {
                _mobiFile = MakeMobiFileNoExth(title);
            }
            else
            {
                _mobiFile = MakeMobiFromExth(exthReader, title);
            }
        }
Example #2
0
        BookFile MakeMobiFromExth(ExthHeaderReader exthReader, string title)
        {
            string author      = exthReader.ReadExthStringValue(100);
            string publisher   = exthReader.ReadExthStringValue(101);
            string description = exthReader.ReadExthStringValue(103);
            string isbn        = exthReader.ReadExthStringValue(104);

            string publishDate = exthReader.ReadExthStringValue(106);

            int?coverOffset = exthReader.ReadExthIntValue(201);
            int?thumbOffset = exthReader.ReadExthIntValue(202);

            return(new BookFile
            {
                Author = author,
                Description = description,
                Isbn = isbn,
                PublishDate = publishDate,
                Publisher = publisher,
                Title = title
            });
        }