tips & tricks


Calendario
luglio 2024
lmmgvsd
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

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: 14.008
  • Views Posts: 56.826
  • 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