Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
EPUB 是一种电子书文件格式,为出版商和消费者提供了一种标准的数字出版格式。现在,这种格式已经非常普遍,许多电子阅读器和软件应用程序都支持这种格式。例如,在 Mac OS 上,预装的 Books 软件就支持打开此类文件。此外,智能手机、平板电脑和电脑上也有各种兼容软件。EPUB 文件标准由国际数字出版论坛(IDPF)负责维护。
Aspose.HTML for .NET 的主要亮点是转换功能。EPUB 是一种基于 XML 的开放式数字图书和出版物格式,可在多种设备上查看和阅读。为了利用其他格式的优势,通常需要进行 EPUB 转换。Aspose.Html.Converters 名称空间实现了对转换方法的轻松访问。它提供了多种流行格式的 EPUB 转换,如PDF、XPS、DOCX、JPG、PNG、BMP、TIFF和GIF。
本节提供支持的EPUB转换列表信息,以及如何使用 Converter.ConvertEPUB()方法执行转换。它可以是不同的方案,但任何EPUB转换可以用几个必要的步骤:
下面的代码片段显示了如何将 EPUB 转换为 PDF:
1// Convert EPUB to PDF using C#
2
3// Open an existing EPUB file for reading
4using FileStream stream = File.OpenRead(DataDir + "input.epub");
5
6// Prepare a path to save the converted file
7string savePath = Path.Combine(OutputDir, "input-output.pdf");
8
9// Create an instance of the PdfSaveOptions class
10PdfSaveOptions options = new PdfSaveOptions();
11
12// Call the ConvertEPUB() method to convert EPUB to PDF
13Converter.ConvertEPUB(stream, options, savePath);在示例中,我们为 ConvertEPUB() 方法指定了 EPUB 文件的源路径。PdfSaveOptions() 构造函数使用默认选项创建 PdfSaveOptions 的实例。 Converter 类的 ConvertEPUB() 方法接收 EPUB 文件源路径、PdfSaveOptions 和输出文件路径,并执行 EPUB 到 PDF 的转换。
注意: 您需要在本地文件系统中指定源文件和输出文件的路径(“sourcePath “和 “outputPath”)。
您可以检查 Aspose.HTML for .NET API 的功能,并实时转换 EPUB。请从本地文件系统加载 EPUB 文件,选择输出格式并运行示例。在示例中,默认设置了保存选项。您将立即收到一个单独文件的结果。
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.