0
之前,我用ITextSharp
在C#for Windows中生成PDF文件,並且它工作得很完美,現在我需要編譯它並在Windows store框架中運行它,我得到錯誤:主要錯誤來自使用System.IO.FileStream
,它不存在於Windows Store API中,是否有另一種類型與Windows Store應用程序中的System.IO.FileStream
相同? 這裏的代碼我使用之前:iTextSharp C#windows store應用程序
String mat;
System.IO.FileStream fs;
Document doc;
mat = textBox1.Text;
fs = new FileStream(mat + ".pdf", FileMode.Create, FileAccess.Write, FileShare.None);
doc = new Document();
PdfWriter writer = PdfWriter.GetInstance(doc, fs);
doc.Open();
String texto = richTextBox1.Text;
doc.Add(new Paragraph(texto));
doc.Close();
this.Hide();
你確定這可以工作嗎?請記住,Windows Store應用程序使用與標準Windows .NET Framework不同的.NET Framework版本,而iTextSharp可能會引用Windows .NET Framework程序集。 – toadflakz
https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.aspx –
你能夠使用'System.IO.MemoryStream'嗎? –