|
C# code
And here is the code fragment that will catch the result from the form and generate
the corresponding document.
protected void showPDF_Click(object sender, System.EventArgs e)
{
TallComponents.PDF.Layout.Document document = new TallComponents.PDF.Layout.Document();
document.Read (new System.Xml.XmlTextReader(new System.IO.StringReader(Request.Form["editor"])));
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=tallpdf_livedemo_xml.pdf");
document.Write( Response );
Response.Close();
}
Change the 'attachment;' definition to 'inline;' and the document will
be opened in the browser (if viewing in the browser has been enabled in the PDF viewer plugin).
|