Guys I'm using file_picker
to get files from the device. I use open_file
to display the file. Is there any way to get the number of pages from the file? I have already seen the possibility with .pdf, but I would like to get from .docs as well.
Asked
Active
Viewed 613 times
2

Ricardo Oscar Kanitz
- 529
- 8
- 19
-
Does this work? [Number of pages of a word document with Python](https://stackoverflow.com/q/12964580/7543069) – Exalted Toast Jul 14 '21 at 23:41
-
The short answer is... Yes, it is. – Ουιλιαμ Αρκευα Jul 14 '21 at 23:49
-
@ΟυιλιαμΑρκευα Do you know how? – Ricardo Oscar Kanitz Jul 15 '21 at 15:20
-
Yes, I do. Check [this post](https://stackoverflow.com/questions/60702252/i-want-to-get-total-pages-count-from-pdf-file) – Ουιλιαμ Αρκευα Jul 15 '21 at 15:49
1 Answers
0
Try Flutter FileReader https://pub.dev/packages/flutter_filereader
A local file view widget,Support a variety of file types, such as Doc Eexcl PPT TXT and so on,Android is implemented by Tencent X5,iOS is implemented by WKWebView
import 'package:flutter/material.dart';
import 'package:flutter_filereader/flutter_filereader.dart';
class FileReaderPage extends StatefulWidget {
final String filePath;
FileReaderPage({Key: Key, this.filePath});
@override
_FileReaderPageState createState() => _FileReaderPageState();
}
class _FileReaderPageState extends State<FileReaderPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("doc"),
),
body: FileReaderView(
filePath: widget.filePath,
),
);
}
}
OR open_document
Opening pdf, xlsx, docs, ppt and zip files # https://pub.dev/packages/open_document

flakerimi
- 2,580
- 3
- 29
- 49
-
1Thanks for your answer, I've tried them but couldn't find any implementation. Besides that ```flutter_filereader``` is crashing my app with its web view. – Ricardo Oscar Kanitz Jul 15 '21 at 15:22