//引用iTextSharp
static void testPdf()
{
var document = new Document();
var writer = PdfWriter.GetInstance(document, new FileStream("./test.pdf",FileMode.Create));
document.Open(); //最小元素
document.Add(new Chunk("Chunk")); //段落
document.Add(new Paragraph("Paragraph")); //短语
document.Add(new Phrase("Phrase")); //list
//是否有编号,是否使用字母进行编号,列表缩进量
document.Add(new List(true, false, )); //表格
//传入列数
//也可传入表示每一列宽度的float[]
var table = new PdfPTable();
var cell = new PdfPCell(new Phrase("cell"));
cell.BorderColor=BaseColor.BLUE;
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
table.AddCell(cell);
document.Add(table); var imgUri = new Uri("https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_86d58ae1.png");
var img = Image.GetInstance(imgUri);
document.Add(img);
document.Close();
}
 
 
 

最新文章

  1. IOS开发基础知识--碎片44
  2. c# BlowFish 高速 对称加密
  3. 小白科普之JavaScript的数组
  4. ****Web API 版本控制的几种方式
  5. Linux 套接字编程中要注意的细节
  6. 刷入临时recovery
  7. PHP 获得当前页面所有变量常量的值
  8. opencv配置
  9. HTML5特性之AJAX跨域
  10. sbb指令
  11. Android应用开发-网络编程(二)
  12. 设计模式《JAVA与模式》之访问者模式
  13. 关于animation的一些简单基础和使用方法记载
  14. android listView 点两下才监听到
  15. P2008 大朋友的数字
  16. PHP面试题一
  17. cocos2d-x开发记录:二,基本概念(动作,动画,坐标系统)
  18. JAVA-用HttpClient来模拟浏览器GET,POST
  19. C的动态链表建立
  20. RandomUser 网站介绍

热门文章

  1. parsing:NLP之chart parser句法分析器
  2. HTTP协议及其相关
  3. .NET(C#、VB)移动开发——Smobiler平台控件介绍:TextTabBar控件
  4. docker (2) 通用/镜像命令
  5. C#通过序列化实现深表复制
  6. MySQL 笔记整理(10) --MySQL为什么有时会选错索引?
  7. img transform:scale 放大在ios下变模糊
  8. 【设计模式】工厂方法模式 Factory Method Pattern
  9. 海量数据,大数据处理技术--【Hbase】
  10. Android防止按钮快速重复点击