[英]base64.encode Not Encoding The whole File , Missing Parts file Encoding Flutter Dart ERROR
i am using following code to encode PDF file to base 64 我正在使用以下代码将PDF文件编码为base 64
File f = new File(_path);
// String base64pdf = base64Encode(f.readAsBytesSync());
String base64pdf = base64.encode(f.readAsBytesSync());
String fileName = _fileName;
print('base64pdf: '+base64pdf);
I tried to encode the pdf file on here: encoding website 我尝试在此处编码 pdf文件: 编码网站
the result from the website shows that the base64 encoder inside flutter(dart) is trimming a big section of the String Generated and give only little first part of it ? 该网站的结果显示,flutter(dart)中的base64编码器正在修整String Generated的很大一部分,而只给出了很少的第一部分?
how to solve that , is this related with byte type? 如何解决,这和字节类型有关吗?
RaisedButton(
onPressed: () async {
List<int> imageBytes = await sampleImage.readAsBytes();
base64Image = base64Encode(imageBytes);
print(base64Image);},),
SizedBox(height: 30,),
Image.memory(base64Decode(base64Image)),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.