espresso3389 / flutter_pdf_render

A Flutter package, which renders PDF pages.
https://pub.dev/packages/pdf_render
MIT License
108 stars 70 forks source link

Can't read asset file with Japanese name #116

Open thao-vu-0106 opened 1 year ago

thao-vu-0106 commented 1 year ago

I try to read file 初めから始める数学Ⅰ新課程.pdf in assets folder, but I can't read that file. But when I change name to Latin character, it works fine.

espresso3389 commented 1 year ago

On which platform do you encounter the issue?

thao-vu-0106 commented 1 year ago

On which platform do you encounter the issue?

My test device is Sony 702SO Android 9, I test another android device, it has same issue.

espresso3389 commented 1 year ago

OK, so, on which OS, which language, and which develop environment do you develop?

thao-vu-0106 commented 1 year ago

I really sorry that I didn't give you clearly information:

class PdfListView extends StatefulWidget { const PdfListView({Key? key}) : super(key: key);

@override State createState() => _PdfListViewState(); }

class _PdfListViewState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: CommonAppBar( title: "Grid Pdf", leading: BackButton( color: Colors.black, ), titleTextStyle: CommonTextStyles.mediumBold, ), body: Center( child: PdfDocumentLoader.openAsset( 'assets/pdf/初めから始める数学Ⅰ新課程.pdf', documentBuilder: (context, pdfDocument, pageCount) => LayoutBuilder( builder: (context, constraints) => GridView.builder( itemCount: pageCount, itemBuilder: (context, index) => GestureDetector( onTap: () { HomeRouter.goBackWithParams(context, index); }, child: Container( margin: EdgeInsets.all(8), padding: EdgeInsets.all(8), color: Colors.black12, child: PdfPageView( pdfDocument: pdfDocument, pageNumber: index + 1, )), ), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, childAspectRatio: 3 / 4), )), ), ), ); } }

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.7.11, on macOS 13.2.1 22D68 darwin-x64, locale en-VN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 14.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.1) [✓] Connected device (3 available) [✓] HTTP Host Availability

• No issues found!