我想将相机捕获的图像(例如:收据)转换为pdf文件,并在应用程序中显示转换后的pdf文件?我已经实现了捕获图像,并在以下代码中将其显示为图像
class PreviewImageScreen extends StatefulWidget {
final String imagePath;
PreviewImageScreen({this.imagePath});
@override
_PreviewImageScreenState createState() => _PreviewImageScreenState();
}
class _PreviewImageScreenState extends State<PreviewImageScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Preview'),
backgroundColor: Colors.transparent,
),
body: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: Image.file(File(widget.imagePath), fit: BoxFit.cover)),
],
),
),
);
}
}
我是新手,所以有人可以帮我做一个例子