public void SaveDocument(MobiDocument document, string saveFilePath) { using (var fs = File.OpenWrite(saveFilePath)) { document.Write(fs, saveFilePath); } }
public MobiDocument LoadDocument(string filePath) { var document = new MobiDocument(filePath); using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { document.PdbHeader = new PdbHeader(fs); document.MobiHeader = new MobiHeader(fs, document.PdbHeader.MobiHeaderSize); } return document; }