flutter_rhwp 2026.5.25
flutter_rhwp: ^2026.5.25 copied to clipboard
Flutter bindings and widgets for rhwp.
flutter_rhwp #
Flutter plugin for reading, viewing, editing, saving, and exporting HWP/HWPX documents.
- Repository: JAICHANGPARK/flutter_rhwp
- Rust core: edwardkim/rhwp, vendored at
rust/vendor/rhwp - Bridge:
flutter_rust_bridgev2 - Version:
2026.5.25
Features #
- Open HWP/HWPX bytes.
- Render pages as SVG.
- Extract text and Markdown.
- Export HWP, HWPX, PDF, DOCX, text, Markdown, and page SVG.
- Use
RhwpViewerfor Flutter-native viewing. - Use
RhwpFullEditorfor the upstream full editor UI. - Use
RhwpCommandEditorfor explicit Flutter/Rust edit commands.
Installation #
Until this package is published, add it from GitHub:
dependencies:
flutter_rhwp:
git:
url: https://github.com/JAICHANGPARK/flutter_rhwp.git
ref: main
Then run:
flutter pub get
Requirements:
- Flutter
>=3.35.0 - Windows full editor: Microsoft WebView2 runtime
- Linux full editor: WebKitGTK 4.1
- Sandboxed macOS full editor with remote
@rhwp/editor: outgoing network client entitlement
Quick Start #
import 'dart:io';
import 'package:flutter_rhwp/flutter_rhwp.dart';
final bytes = await File('sample.hwp').readAsBytes();
final document = await Rhwp.open(bytes, fileName: 'sample.hwp');
final pageCount = await document.pageCount;
final firstPageSvg = await document.renderPageSvg(0);
final text = await document.extractText();
final exportedPdf = await document.exportDocument(RhwpExportFormat.pdf);
await document.close();
Usage #
Viewer:
RhwpViewer(document: document)
Full editor:
final controller = RhwpFullEditorController();
RhwpFullEditor(
controller: controller,
initialBytes: bytes,
fileName: 'sample.hwp',
);
final editedHwp = await controller.exportHwp();
Command editor:
RhwpCommandEditor(document: document)
Edit with Rust bridge commands:
await document.insertText(
section: 0,
paragraph: 0,
offset: 0,
text: 'Hello',
);
Export with save metadata:
final exported = await document.exportDocument(
RhwpExportFormat.pdf,
sourceFileName: 'sample.hwp',
);
// exported.bytes
// exported.fileName
// exported.mimeType
Example #
cd example
flutter run -d macos
The example can open the bundled HWP asset or a picked HWP/HWPX file, then export HWP/HWPX/PDF/DOCX/TXT/MD/SVG.
Notes #
RhwpFullEditoruses upstream@rhwp/editor.- On Web it embeds the editor directly.
- On Android, iOS, macOS, Windows, and Linux it uses
webview_all. - Initial full-editor file loading uses
editor.loadFile(data, fileName). rust/vendor/rhwpshould be committed.rust/targetshould stay ignored.
License #
MIT. See THIRD_PARTY_NOTICES.md for bundled source and dependency notices.