注:此文章大部分内容来源于:iText.in.Action.2nd,如果对这个组件有详细的了解,可以直接查阅此书。
Anchor Image Chapter Section使用
.Text sharp PdfPTable PdfPCell对齐方式,边框,边框颜色的使用
更新日期:2011-5-16
示例基类代码:
class TestBase : IDisposable
2: {
static TestBase()
4: {
5: RegisterFont();
6:
, BaseFont.IDENTITY_H, 12, Font.BOLD | Font.UNDERLINE);
, BaseFont.IDENTITY_H, 12);
, BaseFont.IDENTITY_H, 12, Font.BOLD | Font.ITALIC);
10: }
string BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
void RegisterFont()
13: {
);
);
16: FontFactory.Register(Environment.GetFolderPath(Environment.SpecialFolder.System) +
);
18: FontFactory.Register(Environment.GetFolderPath(Environment.SpecialFolder.System) +
);
20: FontFactory.Register(Environment.GetFolderPath(Environment.SpecialFolder.System) +
);
22: }
23:
string fileName)
new FileStream(fileName, FileMode.OpenOrCreate))
26: {
27: }
28:
protected TestBase()
,
31: BaseDirectory))
32: {
33: }
34:
35: Document document { get; set; }
36: PdfWriter writer { get; set; }
protected TestBase(Stream stream)
38: {
new Document();
40: writer = PdfWriter.GetInstance(document, stream);
41: }
42:
void Open()
44: {
45: document.Open();
46: }
47:
, BaseFont.IDENTITY_H, 12, Font.BOLD | Font.UNDERLINE);
, BaseFont.IDENTITY_H, 12);
, BaseFont.IDENTITY_H, 12, Font.BOLD | Font.ITALIC);
51:
void WriteDocument()
53: {
54: WriteDocument(document, writer);
55: }
void WriteDocument(Document document, PdfWriter writer);
57:
void Dispose()
59: {
null)
61: {
62: document.Close();
63: }
64: }
65: }