Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active October 22, 2015 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/de404407d8bef20c207e to your computer and use it in GitHub Desktop.
Save bjoerntx/de404407d8bef20c207e to your computer and use it in GitHub Desktop.
// save the document as PDF in a session variable
byte[] data;
TextControl1.SaveText(out data,
TXTextControl.Web.BinaryStreamType.AdobePDF);
Session["document"] = data;
// create a new IFRAME and call this ASPX with QueryString
// to load document from session data
ScriptManager.RegisterClientScriptBlock(
this.Page,
this.Page.GetType(),
"alert",
"var iframe = document.createElement('iframe');" +
"iframe.src = 'index.aspx?download=1';" +
"iframe.style.display = 'none';" +
"document.body.appendChild(iframe);",
true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment