public void CompressesEpub() { var accessor = new EpubAccessor(InputFilePath); var extractedEpub = accessor.ExtractToFolder(fixture.OutputFolder); accessor.Compress(extractedEpub, fixture.OutputFolder, true); const string ExpectedCompressedPath = ".\\Output\\test_ebook.epub"; Assert.True(File.Exists(ExpectedCompressedPath)); var inputFileSize = new FileInfo(InputFilePath).Length; var outputFileSize = new FileInfo(ExpectedCompressedPath).Length; AssertAround(inputFileSize, outputFileSize, 0.1m); }
static void Main(string[] args) { const string EpubPath = "./Input/chlopi.epub"; const string OutputFolder = "./Output"; var accessor = new EpubAccessor(EpubPath); var extractedEpub = accessor.ExtractToFolder(OutputFolder); var mimeType = extractedEpub.Mimetype; var mimeTypeContent = extractedEpub.GetTextContent(mimeType); var annotations = extractedEpub.Ops.HtmlFiles.SingleByName("annotations.html"); var annotationsContent = extractedEpub.GetTextContent(annotations); accessor.Compress(extractedEpub, OutputFolder, true); }