Report.NET 是一个功能强大且易用的用来生成 PDF 文档的 C# 组件
示例代码:
using Root.Reports;
using System;
namespace ReportSamples {
/// <summary>Hello World (PDF Version)</summary>
class HelloWorld {
//----------------------------------------------------------------------------------------------------x
/// <summary>Starts the "Hello World" sample.</summary>
public static void Main() {
Report report = new Report(new PdfFormatter());
FontDef fd = new FontDef(report, "Helvetica");
FontProp fp = new FontPropMM(fd, 25);
Page page = new Page(report);
page.AddCenteredMM(80, new RepString(fp, "Hello World!"));
RT.ViewPDF(report, "HelloWorld.pdf");
}
}
}