bengali_pdf 0.1.1
bengali_pdf: ^0.1.1 copied to clipboard
HarfBuzz-shaped, searchable Bengali PDF text for native Flutter platforms, with bundled Noto Sans Bengali and custom font providers.
// Flutter 3.50 deprecates package:flutter/material.dart in favour of
// package:material_ui. Keep the example on the framework import until the
// package raises its minimum Flutter version.
// ignore: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:printing/printing.dart';
import 'services/demo_pdf.dart';
void main() => runApp(const BengaliPdfExampleApp());
/// Interactive cross-platform package demonstration.
class BengaliPdfExampleApp extends StatelessWidget {
/// Creates the example app.
const BengaliPdfExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'bengali_pdf example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xff006a60)),
useMaterial3: true,
),
home: const BengaliPdfPreviewScreen(),
);
}
}
/// Live PDF preview with native print, share, and download actions.
class BengaliPdfPreviewScreen extends StatelessWidget {
/// Creates the preview screen.
const BengaliPdfPreviewScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('bengali_pdf — JehadurRE'),
),
body: PdfPreview(
build: buildBengaliPdf,
canChangeOrientation: true,
canChangePageFormat: true,
canDebug: false,
pdfFileName: 'bengali-pdf-example.pdf',
),
);
}
}