Hello,I have a problems,please help me(dihua.pan@hotmail.com)
> > > Here is the code I used to generate the PDF:
> > >But it works at ie6 and firefox,but not ie7
> > >
> > > using System;
> > > using System.IO;
> > > using iTextSharp.text;
> > > using iTextSharp.text.pdf;
> > >
> > > public partial class appPages_GetPDF : System.Web.UI.Page
> > > {
> > > protected void Page_Load(object sender, EventArgs e)
> > > {
> > > MemoryStream m = new MemoryStream();
> > > Document document = new Document();
> > >
> > > try
> > > {
Response.AppendHeader("Content-Disposition","filename=Reserve.pdf");
> > > Response.ContentType = "application/pdf";
> > > PdfWriter writer = PdfWriter.GetInstance(document, m);
> > > writer.CloseStream = false;
> > >
> > > document.Open();
> > > document.Add(new Paragraph("Hello World"));
> > >
> > > }
> > > catch (DocumentException ex)
> > > {
> > > Console.Error.WriteLine(ex.StackTrace);
> > > Console.Error.WriteLine(ex.Message);
> > > }
> > > document.Close();
> > >
> > > Response.OutputStream.Write(m.GetBuffer(), 0,
> > > m.GetBuffer().Length);
> > > Response.OutputStream.Flush();
> > > Response.OutputStream.Close();
> > > m.Close();
> > > }
> > > }
回复 引用