universal_document_viewer 0.1.1
universal_document_viewer: ^0.1.1 copied to clipboard
Open and read PDF, Word (.docx), Excel (.xlsx), CSV, PowerPoint (.pptx) and text documents in Flutter, with its own document engines.
Changelog #
0.1.1 #
- Screenshots on pub.dev and in the README.
- The example app's home screen is a grid of document cards with large thumbnails and format badges, and its sample documents read like real ones (a guide PDF, a quarterly report, a sales workbook).
- No changes to the package's code.
0.1.0 #
First release.
universal_document_viewer reads every format with its own engines: PDF through its own bindings to PDFium (downloaded at build time from bblanchon/pdfium-binaries, pinned release and SHA-256), and Word, Excel, CSV and PowerPoint with Dart readers written for the package from the file-format specifications.
- Any file:
DocumentViewer.file(path)picks the reader by file type, restoresinitialPosition, reportsonPositionChangedand takes anerrorBuilderand apasswordProviderfor encrypted PDFs. - PDF:
PdfDocumentControllerandPdfDocumentView. Continuous or horizontal layout, pinch/double-tap/wheel zoom with tiled rendering, password-protected files, search with highlights and a text-layer check, web and page links. - Word (.docx):
WordDocumentControllerandWordDocumentView. Parsed off the UI isolate; continuous layout or print layout with measured pages, headers, footers and page numbers; styles, lists, tables with merged cells, images, links, footnotes and endnotes; search. The engine on its own is inword.dart(DocxReader,WordDocument). - Spreadsheets (.xlsx, CSV):
SpreadsheetControllerandSheetGrid, a lazy 2D grid. Column widths and row heights from the file, hidden rows/columns/sheets, frozen panes, merged cells, text and number formatting, links, search, zoom, row/column Count/Sum/Average.- Cell borders, conditional formatting and comments, as the author set them up:
- Conditional formatting: comparisons, text matches, blanks, errors, top/bottom N, above/below average, duplicates, colour scales and data bars. Rules that need a formula evaluated are left out.
- Comments: shown as notes, with a corner marker.
- Tapping a cell shows its formula, as Excel's formula bar does, and its note. A formula filled down a column shows in each cell with its references moved.
SpreadsheetController.goToandshowGoToDialogjump to a cell (D120,Sheet2!B3) or a sheet by name, and mark the cell.freezeTopRowkeeps the header row on screen in a sheet whose file froze none. It's saved in the position asfreeze_top_row.
- Cell borders, conditional formatting and comments, as the author set them up:
- Thumbnails:
DocumentThumbnails.render(path, width:)draws the first page of any supported file as a PNG. Given a savedposition:, it draws the page reading resumes on. The Word and text readers report the paragraph or line at the top (PositionKeys.paragraph,PositionKeys.line) for this. - PowerPoint (.pptx):
SlideDeckController,SlideDeckViewandSlideNavigationBar. Titles, paragraphs, tables and pictures; search. - Text (.txt, .md):
TextDocumentControllerandTextDocumentView. UTF-8 with a Latin-1 fallback, binary-file check, search. - Shared:
DocumentFormat(from extension, path or MIME type),ZipSafetyGuardfor Office files (with a file-size ceiling checked before reading, and parts never inflated past their declared size), reading positions as JSON-safe maps (ReadingPosition,PositionKeys), typed load errors (DocumentLoadError), andtesting.dartbuilders for in-memory test documents. - Platforms: Android, iOS, macOS, Windows and Linux. Web is not supported yet.