Open kebsont opened 4 years ago
it can not read pdf! please, replace pdf file with epub.
Yes, It was an error from me. But I tried epub with, and got the same error. Here is the file: /Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Documents/Epub_Format.epub
What I did is I took an epub url and download it locally, and tried to open it from the getApplicationDocumentsDirectory().
you can try epub file in example to confirm your epub file content is correct.
Yeah I've tried with that one too . I even cloned that repo to try for seeing if it's my epub which is corrupted but got the same error.
confused! can you show your code, let me see it.
child: Container(
height: mediaQuery.size.height - 30,
child: itemProvider.downloaded
? GestureDetector(
onTap: () async {
itemProvider.getDownload().then((v) {
if (v.isNotEmpty) {
ItemModel dl = v[0];
String itemPath = dl.fileUrl;
EpubKitty.setConfig(
"iosBook", "#32a852", "vertical", true);
EpubKitty.open(itemPath);
pageChannel.receiveBroadcastStream().listen((Object event) {
print('page:$event');
}, onError: null);
}
});
},
child: ClipRRect(
borderRadius: BorderRadius.circular(24.0),
child: CachedNetworkImage(
imageUrl:
"imgUrlHere",
placeholder: (context, img) => Center(
child: CircularProgressIndicator()),
errorWidget: (context, img, error) =>
Image.asset(
"assets/images/Diawartou.png",
width: mediaQuery.size.width / 2,
height: (mediaQuery.size.height - 2),
),
),
))
It seems no problem. then print the 'itemPath' and show it .
/Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Documents/Epub_Format.epub
The path is also no problem. I suggest you to try in local first. Copy the Epub_Format.epub into Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Library/Caches, and use following code to get path
Directory appDocDir = await getTemporaryDirectory();
then try open it.
If you can not open your epub , copy example/ios/3.epub to local cache with the same way above.
The same, it's not relative to the path or the file itself.
I've changed the directory to use this one /Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/1DDE1F0A-954F-4B6A-BC6B-335F582B7ABD/Library/Caches/Epub_Format.epub
and it doesn't work, same for the file
Ok,I will check it, give me a little time.
Okay thanks. I'm waiting for ...
You use the example or plugin 0.1.5?
Yes I do.
You can try 0.1.0.
Ok
I got the same error
I found an error on 0.1.5 but not yours.
what is it ? not related with mine ?
Yeah, I found the page not show correctly and will cause a collapse, however, it can read book.
for me I can't even open the first page
I think it's either the wrong path or the file.
No, I'm sure it's not any of them. Because the file I can open it with an epub reader, I even use anothers epub file to test and the path I changed it twice.
Hello, thanks for this plugin. My problem is I can't open any epub file with it. I download it in the device, You can see here its path ( _/Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/A53AE134-67FE-4630-9C4E-7C8F2D95D3F1/Documents/EpubFormat.pdf)
But when I try to open it, I got this error:
I tried with different epub. But I always got the same error.