安卓JAVA將table導出成PDF
来源:互联网 发布:手机掌上贵金属软件 编辑:程序博客网 时间:2024/05/19 01:10
將table導出成PDF是常見的需求,使用itextpdf導出會非常簡單
import java.io.FileOutputStream;import com.itextpdf.text.Document;import com.itextpdf.text.Paragraph;import com.itextpdf.text.pdf.PdfPCell;import com.itextpdf.text.pdf.PdfPTable;import com.itextpdf.text.pdf.PdfWriter;public class DrawPdf { public static void main(String[] args) throws Exception { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("Employee.pdf")); document.open(); Paragraph para = new Paragraph("adidas originals"); para.setSpacingAfter(20); document.add(para); PdfPTable table = new PdfPTable(3); PdfPCell cell = new PdfPCell(new Paragraph("First Name")); table.addCell(cell); table.addCell("Last Name"); table.addCell("Gender"); table.addCell("Ram"); table.addCell("Kumar"); table.addCell("Male"); table.addCell("Lakshmi"); table.addCell("Devi"); table.addCell("Female"); document.add(table); document.close(); }}
阅读全文
0 0
- 安卓JAVA將table導出成PDF
- Java与安卓PDF书籍
- java Itext PDF 导出 table
- JAVA 使用iText导出PDF(含有Table)示例
- 安卓WebView展示在线pdf文档
- java动态生成pdf含表格table和 合并两个pdf文件功能
- HTML TABLE 细边框样式 用HTML作为模板,JAVA导出PDF兼容table样式
- Internal table to PDF
- 安卓通过itext创建包含中文的pdf出错
- 安卓如何去读写word,pdf,elxs文件
- 页面table转存为pdf
- 安卓手机PDF阅读器哪个好用?收下这份PDF阅读器使用方法吧
- 【java】安卓计算器
- 安卓java定时器
- Table.java
- C#制作PDF 之Table和PdfPTable
- 设置PDF页边距,设置Table绝对宽度
- bootstrap-table 导出 excel,pdf,txt等
- 微图App有哪些实用的功能?
- 用户行为日志-js埋点(四)可能存在的问题和总结
- Lambda表达式小例子
- JVM之类加载过程(二)
- 自定义Win7虚拟机的睡眠时间
- 安卓JAVA將table導出成PDF
- 一些常用的Linux命名
- JS中的数组的操作
- Nginx+Tomcat实现简单的负载均衡
- IntelliJ Idea 2017 免费激活方法
- 如何理解Python装饰器?
- CSS3动画实现登录界面
- PHP内核探索之变量(4)- 数组操作
- 服务器 'FILE' 上的 MSDTC 不可用