至于对象转换为文件 [英] Regarding Conversion of Object To File

查看:84
本文介绍了至于对象转换为文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,怎么写对象的Andr​​oid到文件?我在其中都喜欢排,页脚内容,标题信息是增加了一个表格布局。我想这个对象添加为SD卡上的文件,因为我想TableLayout本报告转换为PDF格式。谁能告诉我怎么写PDF Android中使用对象的帮助?

Can anyone please tell me that how to write object to file in Android? I have a table layout in which all the contents like row, footer, header information is added. I want to add this object as a file on sdcard, as I want to convert this report of TableLayout in pdf form. Can anyone please tell me how to write PDF in Android with the help of object?

推荐答案

生成的服务器,而不是设备PDF。 PDF生成涉及许多操作和外部库。这将是设备很慢,需要你写的$相对较多线C $ CS,不会给优雅输出由Web服务器。

Generate PDF on server instead of device. PDF generation involves numerous operations and external libraries. it will be very slow on device, will need you to write comparatively more lines of codes and will not give as elegant output as by a web server.

我猜你必须从服务器本身(作为其传统的应用程序模型)来获取数据,因此只需创建一个Web服务,可以为您提供所需的表的PDF文件。

i guess you must be getting data from a server itself(as its traditional app model), so just create a web service which can provide you a PDF file with desired table .

这样的一种方式可以是:

one way of doing this can be :

从网页 http://sourceforge.net/projects/itext/在你的Java项目中使用它。
rel=\"nofollow\">一个很好的教程

Download the iText core binary from the webpage http://sourceforge.net/projects/itext/ and use it in your java project. a good tutorial here

如果你没有一台服务器,但创建一个是不是对你的问题,就去做。一定会帮助你在未来。

in case you do not have a server, but creating one is not a problem for you, just do it . will surely help you in future.

,尝试在上面的回答@pratik片段。

in case you want to provide offline pdf generation feature, which means user don't need internet connectivity for this, try snippet by @pratik in above answer.

这篇关于至于对象转换为文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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