当前位置:网站首页>iTextSharp 基础结构
iTextSharp 基础结构
2022-04-23 01:22:00 【心前阳光】
一般结构
//1. 创建Document 实例
Document doc = new Document();
//2. 创建PdfWriter 实例
PdfWriter.GetInstance(doc, new FileStream("Chapter01.pdf", FileMode.Create));
//3. 打开文档
doc.Open();
//4. 要显示的内容加入文档
doc.Add(new Paragraph("Hello World!"));
//5. 关闭文档
doc.Close();
安全结构
//使用 using 大括号内容执行完毕 自动关闭文档
//1. 创建文档
using (Document doc = new Document())
{
//2. 创建PDfWriter
PdfWriter.GetInstance(doc, new FileStream("Chapter01.pdf", FileMode.Create));
//3. 打开文档
doc.Open();
//4. 显示内容 加入文档
doc.Add(new Paragraph("Hello World!"));
}
版权声明
本文为[心前阳光]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43796392/article/details/124342036
边栏推荐
- [HCTF 2018]admin
- In depth analysis of disk cache mechanism and SSD write amplification under Linux
- Fault analysis | federated storage engine table causes the monitoring thread to be in the opening table state
- Interface automation session authentication solution
- Jijian cloud x servicego: help hardware manufacturers realize intelligent management of equipment repair and maintenance
- Real time monitoring and management of distribution circuit power consumption of acrel-2000 power monitoring system in xingqingfang Xinxing square distribution substation
- Three technical solutions of ant group were selected as "typical solutions for information technology application and innovation in 2021"
- From thinking to practice, digital transformation is the successful path of it operation
- Introduction à la structure de stockage de gbase 8S et à la gestion de l'espace
- Function encapsulation such as addition, deletion, modification and query of linked list (summary)
猜你喜欢

【Android工程师与智能家居产品的第一次接触③】SmartConfig一键配网在硬件端的具体实现|ESP8266一键配网在Arduino的具体实现|玉念聿辉
![[actf2020 freshman competition]](/img/0c/4c06112383c0b225c987a499b622a9.png)
[actf2020 freshman competition]

200. Number of islands

The origin explanation and use example of image pre training model

计蒜客:数独(DFS)

engine.POST()处理POST请求

10月24号是什么?中国的高级程序员为什么没有五六十岁的,而国外人、、、,玉念聿辉带你过1024程序员节日

Cloud native Virtualization: building edge computing instances based on kubevirt

Linked list dynamic header insertion
![[server data recovery] data recovery case of server crash after the hard disk of the server is flooded](/img/8f/aaa76cf4c578555dfd89c6865c61c2.jpg)
[server data recovery] data recovery case of server crash after the hard disk of the server is flooded
随机推荐
gin -get请求的小示例1-Handle处理GET请求
简单聊聊Ruby
gin--hello
GBASE 8s 共享内存缓冲池介绍
Cai Guoqiang's fireworks NFT debut is as wonderful as fireworks during the day
DFS奇偶性剪枝
【Android工程师与智能家居产品的第一次接触③】SmartConfig一键配网在硬件端的具体实现|ESP8266一键配网在Arduino的具体实现|玉念聿辉
Cloud native Virtualization: building edge computing instances based on kubevirt
Introduction to gbase 8s shared memory buffer pool
10月24号是什么?中国的高级程序员为什么没有五六十岁的,而国外人、、、,玉念聿辉带你过1024程序员节日
IMX6ULL裸机开发之配置eLCDIF点亮RGB液晶屏分析及配置过程
What is the legal basis and procedure for Tami dog sharing | state owned equity transfer?
Articles for May
Get in the car, the era of intelligent database autonomy has come, and Tencent cloud database x AI has made a new breakthrough
IMX6ULL裸机开发之EPIT周期性定时器分析及配置过程
Comp1011 programming solution
Daily practice (47): find different
Gbase 8s存储结构简介及空间管理
修改数组(并查集)
Initial experience of talent plan learning camp: communication + adhering to the only way to learn open source collaborative courses