注:此文章大部分内容来源于:iText.in.Action.2nd,如果对这个组件有详细的了解,可以直接查阅此书。

Hello  Word

中文支持

Chunk Phrase Paragraph List使用

Anchor Image Chapter Section使用

一步一步ITextSharp 低级操作函数使用

一步一步 ITextSharp Table使用

.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:    }

相关文章:

  • 2021-09-21
  • 2021-06-04
  • 2021-12-27
  • 2022-01-22
  • 2021-07-25
  • 2021-10-02
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2021-08-06
  • 2021-07-29
  • 2021-11-16
  • 2022-02-08
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案