Chỉnh sửa EPUB trong Java

Chỉnh sửa EPUB hiệu quả và mạnh mẽ bằng cách sử dụng GroupDocs.Editor phía máy chủ cho các API Java mà không cần sử dụng bất kỳ phần mềm nào như Microsoft hoặc Open Office.


Tải Xuống Dùng Thử miễn phí

Giới thiệu về API GroupDocs.Editor for Java

API [GroupDocs.Editor for Java] (/vi / editor / java /) là một lựa chọn đúng đắn để chỉnh sửa tài liệu và bản trình bày Microsoft Word, Excel, PowerPoint, Open Office. GroupDocs.Editor là một API độc lập phù hợp với hệ thống phía máy chủ và hệ thống back-end nơi yêu cầu hiệu suất cao. Nó không phụ thuộc vào bất kỳ phần mềm nào như Microsoft hoặc Open Office.

Các bước chỉnh sửa EPUB trong Java

[GroupDocs.Editor for Java] (/vi / editor / java /) cung cấp một cách dễ dàng và đơn giản để nhà phát triển chỉnh sửa tệp EPUB bằng một vài dòng mã.

  • Tạo một phiên bản của lớp Editor với đường dẫn tệp bắt buộc hoặc luồng byte và tải tệp EPUB
  • Tạo và đặt phiên bản lớp EbookEditOptions cho định dạng tệp EPUB
  • Gọi phương thức Editor.Edit () và lấy tài liệu EPUB ở định dạng HTML có thể chỉnh sửa dễ dàng bằng bất kỳ trình soạn thảo WYSIWYG nào.
  • Gọi phương thức Editor.Save () và lưu tệp EPUB đã chỉnh sửa bằng cách sử dụng lớp EpubSaveOptions hoặc Azw3SaveOptions để lưu thành các định dạng ePub hoặc AZW3 tương ứng

yêu cầu hệ thống

Chỉnh sửa tài liệu cơ bản với API GroupDocs.Editor for Java có thể được thực hiện bằng cách triển khai một vài bước đơn giản. API của chúng tôi được hỗ trợ trên tất cả các nền tảng và hệ điều hành chính. Trước khi thực hiện mã bên dưới, hãy đảm bảo rằng bạn đã cài đặt các điều kiện tiên quyết sau trên hệ thống của mình.

  • Hệ điều hành: Microsoft Windows, Linux, MacOS
  • Môi trường phát triển: NetBeans, IntelliJ IDEA, Eclipse
  • Các khuôn khổ: Java 7 (1.7) and above
  • Tải xuống phiên bản mới nhất của GroupDocs.Editor for Java từ [Maven] (https://repository.groupdocs.com/editor/)

// Load the EPUB file into Editor
Editor editor = new Editor("source.epub");

// Create and adjust the edit options, common for all e-book formats, including EPUB
EbookEditOptions editOptions = new EbookEditOptions();

// Open input EPUB document for edit — obtain an intermediate document, that can be edited
EditableDocument beforeEdit = editor.edit(editOptions);

// Grab EPUB document content and associated resources from editable document
string content = beforeEdit.getEmbeddedHtml();

// Send the content to WYSIWYG-editor, edit it there, and send edited content back to the server-side
// This step simulates a such operation
string updatedContent = content.replace("Adventure", "Edited Adventure");

// Grab edited content and resources from WYSIWYG-editor and create a new EditableDocument instance from it
EditableDocument afterEdit = EditableDocument.fromMarkup(updatedContent, null);

// Create and adjust the save options, separate for every e-book format
EpubSaveOptions epubSaveOptions = new EpubSaveOptions();//for ePub
Azw3SaveOptions azw3SaveOptions = new Azw3SaveOptions();//for AZW3

// Save edited EPUB document to the ePub format
editor.save(afterEdit, outputPath, epubSaveOptions);

// Save edited EPUB document to the AZW3 format
editor.save(afterEdit, outputPath, azw3SaveOptions);

Bản trình diễn trực tiếp của EPUB Editor

Chỉnh sửa EPUB ngay bây giờ bằng cách truy cập trang web [GroupDocs.Editor Live Demos] (https://products.groupdocs.app/editor/family) trang web. Bản demo trực tiếp có những lợi ích sau

Không cần phải tải VỀ API

Không cần phải viết bất kỳ mã

chỉ cần tải lên các tập tin nguồn

Nhận liên kết tải xuống để lưu tệp

Các trình chỉnh sửa được hỗ trợ khác

Bạn cũng có thể chỉnh sửa các định dạng tệp khác. Vui lòng xem danh sách đầy đủ bên dưới.

DOC

(Microsoft Word Binary Format)

DOCX

(Office 2007+ Word Document)

DOCM

(Microsoft Word 2007 Marco File)

DOTX

(Microsoft Word Template File )

XLS

(Microsoft Excel Spreadsheet (Legacy))

XLSX

(Open XML Workbook)

XLSM

(Macro-enabled Spreadsheet)

PPT

(Microsoft PowerPoint 97-2003)

PPTX

(Open XML presentation Format)

PPTM

(Macro-enabled Presentation File)

MOBI

(Open Ebook Format)

HTML

(Hyper Text Markup Language)

MHTML

(Web Page Archive Format)

TXT

(Text Document)

XML

(XML File)

CSV

(Comma Seperated Values)

RTF

(Rich Text Format)

ODT

(OpenDocument Text File Format)

MSG

(Outlook Message Item File)

EML

(E-Mail Message)

Back to top
 Tiếng Việt