当前上下文中不存在名称 'process'

The name 'process' does not exist in current context

我正在查看 iText7 快速启动示例,如图所示 here。在 "Publishing a database" 部分。我创建了一个基本的 .Net 控制台应用程序并复制并粘贴了代码。我不断在 process(table, line, bold, true);process(table, line, font, false);

行收到 "The namespace 'process' does not exist in the current context" 错误

我看到一个关于 PDFsharp 的类似问题 它说使用 System.Diagnostics.Process.Start,但这似乎并没有解决我的问题。

var writer = new PdfWriter(dest);
var pdf = new PdfDocument(writer);
var document = new Document(pdf, PageSize.A4.Rotate());
document.SetMargins(20, 20, 20, 20);
var font = PdfFontFactory.CreateFont(FontConstants.HELVETICA);
var bold = PdfFontFactory.CreateFont(FontConstants.HELVETICA_BOLD);
var table = new Table(new float[] { 4, 1, 3, 4, 3, 3, 3, 3, 1 });
table.SetWidth(UnitValue.CreatePercentValue(100));
StreamReader sr = File.OpenText(DATA);
var line = sr.ReadLine();
process(table, line, bold, true);
while ((line = sr.ReadLine()) != null)
{
  process(table, line, font, false);
}
sr.Close();
document.Add(table);
document.Close();

消除 "The namespace 'process' does not exist in the current context" 错误的正确方法是什么?

您应该阅读本文的其余部分。实现是下层的。