iText官方教程
来源:互联网 发布:sql server 2016 win7 编辑:程序博客网 时间:2024/06/09 18:35
如果要导出PDF文件,首选当然是iText,从网上也找了些资料,有很多,也有些乱。
自己做了个例子,感觉还是很浅,深入的内容还是研究不透。下载了官方的jar包,本来想看看
里面的Demo,结果只有api文档。资料还真是不好找。
今天发现官方还是有很多例子代码的。
下载地址:http://itextpdf.com/examples/
iText官网: http://itextpdf.com/
在首页下面有个Online resources
下面有个 example code 的链接,点击进入后,发现里面是个很华丽的教程,配备实例代码!
http://itextpdf.com/book/examples.php
这比网上其他人写的博客要权威多了,发现这个好东西,和大家分享一下。
里面有16章,内容相当全,还有演示视频。
这是HelloWord例子,其他自己研究吧:
/* * This class is part of the book "iText in Action - 2nd Edition" * written by Bruno Lowagie (ISBN: 9781935182610) * For more info, go to: http://itextpdf.com/examples/ * This example only works with the AGPL version of iText. */ package part1.chapter01; import java.io.FileOutputStream;import java.io.IOException; import com.itextpdf.text.Document;import com.itextpdf.text.DocumentException;import com.itextpdf.text.Paragraph;import com.itextpdf.text.pdf.PdfWriter; /** * First iText example: Hello World. */public class HelloWorld { /** Path to the resulting PDF file. */ public static final String RESULT = "results/part1/chapter01/hello.pdf"; /** * Creates a PDF file: hello.pdf * @param args no arguments needed */ public static void main(String[] args) throws DocumentException, IOException { new HelloWorld().createPdf(RESULT); } /** * Creates a PDF document. * @param filename the path to the new PDF document * @throws DocumentException * @throws IOException */ public void createPdf(String filename)throws DocumentException, IOException { // step 1 Document document = new Document(); // step 2 PdfWriter.getInstance(document, new FileOutputStream(filename)); // step 3 document.open(); // step 4 document.add(new Paragraph("Hello World!")); // step 5 document.close(); }}
- iText官方教程
- iText官方教程
- iText使用教程(1)
- iText使用教程(2)
- iText使用教程(3)
- iText使用教程(4)
- iText使用教程(5)
- iText使用教程(6)
- iText
- iText
- ITEXT
- iText
- iText
- itext
- itext
- itext
- IText
- 新手结婚官方教程.
- C#捕获摄像头进行拍照和录像资料总结
- pagerank比较透彻的讲解文章
- C# WinForm开发系列 - Crystal Report水晶报表
- 文件目录
- 小屁孩的伤感空间日志_多谢伱的不珍惜让我学会死訫
- iText官方教程
- s3c6410 串口初始化
- CentOs5.4 64/32位系统 ---安装Tomcat6
- 【阅读笔记之八】《DIRECTX.9.0.3D游戏开发编程基础》:Direct3D中的纹理与映射
- 浅谈Sharepoint权限 sharepoint 2010 不允许对继承权限的对象执行此操作
- 解决每次从Linux Mint Debian切换回Win7后的时间错误
- 我们该怎样度过我们的研究生生活
- 亲爱的,我的眼泪不多,请不要我再为你流泪好吗?
- [erlang]ets结合record的增删改查操作