我正在學習本教程,但我沒有將我的pdf文件保存到哪裏?謝謝您的幫助!我的FileStream創建文件保存在哪裏?
using System;
using com.lowagie.text;
using com.lowagie.text.pdf;
using System.IO;
public class Chap0101
{
public static void Main(string[] args)
{
Console.WriteLine("Chapter 1 example 1: Hello World");
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document, new FileStream("Chap0101.pdf", FileMode.Create));
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Paragraph("Hello World"));
// step 5: we close the document
document.close();
}
}
做一個搜索 –
或者更好的是指定一個絕對路徑 – leonbloy
是的,你應該指定一個輸出FileStream –