image - 如何在颤振中以base64显示pdf?
问题描述
我有 base64 格式的 pdf 内容,我需要在颤振应用程序的容器中显示它。
我正在尝试使用图像、pdf 并从 dart 转换包,但图像类出现错误,我不知道如何显示图像。
List<int> pdfDataBytes = base64.decode(fileContent);
Image img = decodeImage(pdfDataBytes);
PdfImage image = PdfImage(
pdf,
image: img.data.buffer.asUint8List(),
width: img.width,
height: img.height);
这是图像类中的错误消息:尝试对其中一个导入指令使用“作为前缀”,或者对除一个导入之外的所有导入指令隐藏名称
解决方案
我没有测试它,但你有显示 pdf 的颤振包:flutter full pdf viewer 你可以在这里找到一个使用这个包和 pdf 资产的例子。
推荐阅读
- python - 如何从python中的字符串值中获取字典对象
- php - Composer install Laravel:您的需求无法解析为一组可安装的软件包
- azure - 使用子网 ID 的引用创建 AKS 群集时出错
- sql - 调整 Postgres 查询
- sql-server - Microsoft SQL Server 编辑导入的文件
- openstreetmap - OSM - 在特定边界框中查找所有可选路线
- python - Thingspeak:使用 Python 解析 json 响应
- go - 为什么永远不会调用终结器?
- c++ - OpenSSL BIO 和 SSL_read
- python-2.7 - 如何在 Python 单元测试中获取和断言以及 REST API?