This is a very basic package to view Microsoft Documents like Word, SpreadSheet and Presentations.
Its built for the latest Microsoft files with extensions .docx, .xlsx and .pptx.
Currently its a very basic viewer and more features will be added progressively.
Email to info@karmalaya.in, in case you are ready to fund the project, contribute further to this project or need some specific customization.
Features
- Read .docx file and show text, images and tables with most of the formatting options handled.
- Read .xlsx file and show the tables, with minimum formatting.
- Read .pptx file and show text, background image and diagrams, with no formatting.
Getting started
Add the package to your project and then pass the bytes of the .docx/.xlsx/.pptx to the Viewer.
Usage
Add MicrosoftViewer into your build function as any other widget. Pass the byte data from the document you want to view. If the size of the widget is constrained by any height/width, set the next parameter as true.
Below is a simple example.
//for getting data from asset files
ByteData byteData=await rootBundle.load(fileName);
@override
Widget build(BuildContext context) {
return MicrosoftViewer(Uint8List.sublistView(byteData),false);
}
//for getting data from network
var response = await http.get(Uri.parse(filePath));
@override
Widget build(BuildContext context) {
return SizedBox(
height:200,
child:MicrosoftViewer(response.bodyBytes,true)
);
}
Additional information
Microsoft office files are created on a proprietary logic and needs a lot of research to understand it.
Hence building this package needs a lot of effort to understand the logic and then convert them into Flutter widgets.
There are many 3rd party SDKs available with complex features but charge heavily for the same.
Most of the Flutter developer need just the simple viewer functionality and this package is built with that requirement.
Any financial support or knowledge sharing or effort sharing will help in building this package faster.
Libraries
- data/alphabets
- data/indexed_color
- data/number_format
- domain/common_processor
- domain/presentation_processor
- domain/spreadsheet_processor
- domain/word_processor
- microsoft_viewer
- models/document
- models/font_details
- models/foot_end_note
- models/ms_image
- models/ms_ss_table
- models/ms_table
- models/ms_text_span
- models/paragraph
- models/presentation
- models/presentation_image
- models/presentation_paragraph
- models/presentation_shape
- models/presentation_text
- models/presentation_text_box
- models/relationship
- models/sheet
- models/slide
- models/spreadsheet
- models/ss_color_schemes
- models/ss_style
- models/styles
- models/word_page
- utils/odttf
- widget/custom_bullet_painter
- widget/progress_indicator