tips & tricks


Calendario
febbraio 2025
lmmgvsd
272829303112
3456789
10111213141516
17181920212223
242526272812
3456789

PDF Preview

PDF Preview


Per vedere un pdf in pagina mi basta mettere un Iframe e salvare i byte del documento su filesystem dopodichè cambio il source dell'Iframe.


<iframe runat="server" id="frameDisplayDocId"  width="500px" height="800px"></iframe>


protected void Page_Load(object sender, EventArgs e)

    {

        string docName = Request.QueryString["docName"];

        string docId = Request.QueryString["docId"];

        string docExtension = Request.QueryString["docExtension"];

        byte[] document = GetDocumentByte();

        if (document != null)

{

        string SaveLocation = string.Format(@"{0}\SuitesUploadFolder\{1}\");

        System.IO.File.WriteAllBytes(SaveLocation + docId + "." + docExtension, document);

         string fileFullPath = "../../../SuitesUploadFolder/+ docId + "." + docExtension;

  frameDisplayDocId.Attributes.Add("src", fileFullPath);

       }

     

    }

 

Categoria: ASP.NET
mercoledì, 06 nov 2013 Ore. 12.26
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
Statistiche
  • Views Home Page: 15.301
  • Views Posts: 58.677
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003