图像以 base64 编码的形式存储在 sqflite 数据库中。 PNG 图像使用此代码完美显示。 From here
try {
bytes = base64.decode(<base64 Image String>);
image = PdfImage.file(
pdf.document,
bytes: bytes,
);
} catch (e) {
bytes = null;
image = null;
}
但不适用于 jpeg base64 编码图像。
任何帮助将不胜感激。
答案 0 :(得分:0)
这篇博文有误。
这是一个更好的例子: https://gist.github.com/DavBfr/a70e763582e95f70331d14ad03ddfe7d