iText 7 C#xamarin android hello world失败

时间:2020-03-08 16:49:02

标签: c# android xamarin.android itext7

我在针对android API级别26的xamarin android项目中使用了iText 7 nuget软件包版本7.1.10,并使用了C#版本8。

所以我去了itext7 here的快速入门教程,我复制并粘贴了hello world代码

var dest = new FileInfo("/sdcard/pdftest.pdf");
var writer = new PdfWriter(dest);
var pdf = new PdfDocument(writer);
var document = new Document(pdf);
document.Add(new Paragraph("Hello World!"));
document.Close();

但是当代码到达 document.Add 行时,我得到了

System.ArgumentNullException:'值不能为null。 参数名称:assembly'

我在做什么错了?

PS:我也尝试使用C#7.1,但该行仍然失败。

0 个答案:

没有答案