如何在将文件上传到Firebase存储和数据库之前先压缩pdf文档 [英] How to compress the pdf document before uploading to firebase storage and database in flutter
问题描述
在我的flutter项目中,我(用户)必须上传pdf数量.因此,要保守地使用Firebase,我需要在将图像和pdf上传到Firebase存储时对其进行压缩.
In my flutter project I (users) have to Upload number of pdfs. So to use the firebase conservatively I need to compress the images and pdfs while uploading to the firebase storage.
注意:我正在使用Firebase Spark Plan(仅免费提供5GB)
Note: I am using firebase spark plan ( free upto 5GB only)
请向我建议一种压缩pdf文档的技术,因为我正在使用file_picker来选择pdf文档,然后使用firebasestorage进行上传.
Please suggest me a techinique for compressing pdf documents as I am using file_picker for picking pdfs documents and then firebasestorage to upload.
坦白地说,我已经搜索了pub.dev,但没有找到任何内容.
Frankly speaking I have searched pub.dev , but did'nt find any.
推荐答案
这是解决方案,我创建了一个flutter程序包.目前它仅适用于android设备,并且压缩质量非常好.您可以在此处查看 https://pub.dev/packages/pdf_compressor
Here is the solution, i have created a flutter package. For now it works only for android device, and compression quality is pretty good. you can check it out here https://pub.dev/packages/pdf_compressor
这篇关于如何在将文件上传到Firebase存储和数据库之前先压缩pdf文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!