C# 导出PDF格式
我先前的问题很模糊。我仍然不知道怎么做,我是新来这里的c/XAML windows 8应用程序。这是我的密码C# 导出PDF格式,c#,xaml,C#,Xaml,我先前的问题很模糊。我仍然不知道怎么做,我是新来这里的c/XAML windows 8应用程序。这是我的密码 using System; using System.Collections.Generic; using System.Text; using iTextSharp.text; namespace iTextSharpTester { public class PDFCreator { // Set up the fonts to be used on the pages
using System;
using System.Collections.Generic;
using System.Text;
using iTextSharp.text;
namespace iTextSharpTester
{
public class PDFCreator
{
// Set up the fonts to be used on the pages
private iTextSharp.text.Font _largeFont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 18, iTextSharp.text.Font.BOLD, iTextSharp.text.BaseColor.BLACK);
private iTextSharp.text.Font _standardFont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 14, iTextSharp.text.Font.NORMAL, iTextSharp.text.BaseColor.BLACK);
private iTextSharp.text.Font _smallFont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 10, iTextSharp.text.Font.NORMAL, iTextSharp.text.BaseColor.BLACK);
public void Build()
{
iTextSharp.text.Document doc = null;
try
{
// Initialize the PDF document
doc = new Document();
iTextSharp.text.pdf.PdfWriter writer = iTextSharp.text.pdf.PdfWriter.GetInstance(doc,
new System.IO.FileStream(System.IO.Directory.GetCurrentDirectory() + "\\asd.pdf",
System.IO.FileMode.Create));
// Set the margins and page size
this.SetStandardPageSize(doc);
这里的问题是System.IO.Directory.GetCurrentDirectory、System.IO.FileStream和System.IO.FileMode.Create。它说这些代码不存在于名称空间System.IO中。提前谢谢!这是针对windows 8应用程序的。顺便说一句,我只是在学习itextsharp的文章教程。代码在wpf中,我正试图在windows 8应用程序中传输它