私はこのライブラリを初めて使用し、いくつかの例を見つけました(PDFをページごとに分割しています)。
しかし、誰かが使い始めると常にFilestream
エラーが発生します(Object reference not ...)
。作成中Filestream
はエラーは発生しません。どうしたの?ここからダウンロードしたライブラリ。
編集
private static void Test()
{
Document pdfDocument = new Document( );
PdfWriter.GetInstance(pdfDocument,
new FileStream("D:\\WDPT.PDF", FileMode.Create));
// here is eror
pdfDocument.Open( );
pdfDocument.Add(new Paragraph("Here is a test of creating a PDF"));
pdfDocument.Close( );
}
このコードはコンソールアプリケーションで実行されます。ここでのエラーは、ファイルストリームの使用を開始したときに発生します(他の場合と同様)。