シナリオを投げました: itext sharpバージョン:5.5.21 - PCLプロジェクトとネイティブプロジェクトの両方でうまくいきました。 itext7バージョン:7.1.0 - これは以前のバージョンで修正されていると言われていますフォーラムでエラー
System.TypeInitializationException: The type initializer for
'iText.IO.Util.ResourceUtil' threw an exception. --->
System.TypeInitializationException: The type initializer for
'Microsoft.Extensions.DependencyModel.DependencyContextLoader' threw an
exception. ---> System.TypeInitializationException: The type initializer for
'Microsoft.Extensions.DependencyModel.DependencyContextPaths' threw an
exception. ---> System.NotImplementedException: The method or operation is not
implemented.
下になりました。ブレークポイントのヒットが、それは誤りの上上げるPdfFont間、私は以下before.Attachを初期化する必要がある任意のものは、
PdfDocument pdf = new PdfDocument(new PdfWriter(fs, new WriterProperties().AddXmpMetadata()));
Document document = new Document(pdf);
pdf.SetTagged();
pdf.GetCatalog().SetLang(new PdfString("en-US"));
pdf.GetCatalog().SetViewerPreferences(new PdfViewerPreferences().SetDisplayDocTitle(true));
PdfDocumentInfo info = pdf.GetDocumentInfo();
info.SetTitle("iText7 PDF/UA example");
PdfFont font = PdfFontFactory.CreateFont(FONT, PdfEncodings.WINANSI, true);
Paragraph p = new Paragraph();
p.SetFont(font);
p.Add(new Text("The quick brown "));
document.Add(p);
document.Close();
をコードを試してみました。
:
このチュートリアルでは、ジャンプスタートを与えるだろう。コンソールアプリケーションとして実行すると、同じコードがうまく動作しますが、XamarinフォームやPCLでは機能しませんでした。 – vijay