如何使用颤动将图像转换为pdf? [英] How to convert image to pdf using flutter?

查看:91
本文介绍了如何使用颤动将图像转换为pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了一个应用程序,可以使用相机捕获图像并在新页面中将捕获的图像显示为图像,但是我想将捕获的图像(例如:文档)显示为Pdf文件(可编辑).

I have implemented a app to capture images using camera and display captured image in new page as a Image but I want to display the captured Image(ex:document) as Pdf file(editable).

那么如何将我的图像(例如:文档)转换为pdf文件?

So how can I convert my image(ex:document) as a pdf file ?

class DisplayPictureScreen extends StatelessWidget {
  final String imagePath;
  const DisplayPictureScreen({Key key, this.imagePath}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Display the Picture')),
      body: Image.file(File(imagePath)),
    );
  }
}

推荐答案

此颤动的打印库进行了讨论关于要从ImageProvider加载图像:也许这可以满足您的要求,您可以在处理完图像后提取PDF

This flutter printing library talks about To load an image from an ImageProvider: perhaps this might do what you ask, you might be able to extract the PDF after its processed the image

这篇关于如何使用颤动将图像转换为pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆