【发布时间】:2012-03-31 13:23:33
【问题描述】:
我正在尝试在我的 Windows Mobile 的 C# 程序中包含一个 html 到 pdf 转换器。
我找到了 Pdfizer。
我添加了对 Pdfizer.dll 的引用并将其包含在 using Pdfizer; 中
我还添加了对 Pdfizer 所需的 itextsharp 的引用。
Pdfizer 已正确添加,我可以使用它的许多函数和类,但我不能使用 HtmlToPdfConverter.Run()
我的代码:
FileStream filePDF;
filePDF = File.Create(path + ".pdf"); // path is string
html2pdf.Open(filePDF);
html2pdf.AddChapter(@"Chapter name");
html2pdf.Run(html); // html is a string that contains html code
html2pdf.Close();
问题就在html2pdf.Run(html); 一行,上面写着:
Error 1 The type 'System.Uri' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Run的定义是
public void Run(string html);
public void Run(Uri uri);
我正在尝试使用 Run(string html) 选项,但 Uri 已定义,Visual Studio 说它没有被引用,但是是的。
我有 using System; 包含 Uri 类,确实我在其他功能中使用它并且工作正常。
有什么问题?我应该添加对System, Version=1.0.5000.0 的引用吗?我在哪里可以找到它?有没有办法告诉 Pdfizer Uri 在 System.Uri 中?
谢谢
【问题讨论】:
标签: c# visual-studio-2008 windows-mobile pdf-generation itextsharp