电子书转换器

Sheetize eBook Converter for .NET 可轻松地将文档转换为和从流行电子书格式,如 EPUB 和 MOBI. 它非常适合出版商、数字图书馆和开发人员在应用程序中集成電子书功能。

主要特点

PDF 到 EPUB 转换

轻松地将 PDF 文件转换为 EPUB 格式,为 eReaders 和其他支持 eBook 的设备优化。

EPUB 到 PDF 转换

将电子书内容从 EPUB 转换为 PDF,使其适合印刷或离线观看,以标准格式。

详细指南

将 PDF 转换为 EPUB

将 PDF 文档转换为 EPUB 电子书:

  • 启动转换器 :创建一个例子 EbookConverter.
  • 设置转换选项 :使用 PdfToEpubOptions 设置 EPUB 输出设置,如图像处理和代数据。
  • 定义输入和输出路径 :为 PDF 和 EPUB 输送设置路线。
  • 执行转换 :呼叫 Process 转换文档的方法。

例如:将 PDF 转换为 EPUB

// Step 1: Initialize the eBook Converter
var converter = new EbookConverter();

// Step 2: Configure options for PDF to EPUB conversion
var options = new PdfToEpubOptions();
options.IncludeImages = true; // Include images in the output EPUB
options.SetMetadata("Title", "Converted eBook");

// Step 3: Set file paths
options.AddInput(new FileDataSource("input.pdf"));
options.AddOutput(new FileDataSource("output.epub"));

// Step 4: Run the conversion
converter.Process(options);

可用的 PDF 到 EPUB 转换选项

  • IncludeImages : 指定是否将原始PDF的图像添加到结果的EPUB中。
  • SetMetadata :添加代数据,如标题、作者和主体到EPUB文件。

将 EPUB 转换为 PDF

要将 EPUB 文件转换为 PDF:

  • 启动转换器 :创建一个例子 EbookConverter.
  • 设置 PDF 选项 :使用 EpubToPdfOptions 定义设置,如页面布局和边界。
  • 指定路径 :设置输入 EPUB 和输出 PDF 文件路线。
  • 执行转换 :呼叫 Process 完成转换的方法。

例如:将 EPUB 转换为 PDF

// Step 1: Initialize the eBook Converter
var converter = new EbookConverter();

// Step 2: Configure options for EPUB to PDF conversion
var options = new EpubToPdfOptions();
options.PageLayoutOption = PageLayoutOption.Portrait;
options.Margin = new MarginSettings(10, 10, 10, 10);

// Step 3: Set file paths
options.AddInput(new FileDataSource("input.epub"));
options.AddOutput(new FileDataSource("output.pdf"));

// Step 4: Execute the conversion
converter.Process(options);

EPUB 到 PDF 转换的额外选项

  • PageLayoutOption :为结果的PDF设置页面布局,例如: PortraitLandscape.
  • MarginSettings :为 PDF 输出设置边界。

这个转换器对出版商和开发人员都非常有用,需要自动化与电子书相关的工作流。 无论是从 PDF 文档中创建 eBooks 还是为打印制作 eBook 文件, Sheetize ebook Converter 都提供了一个灵活的解决方案。

 中文