博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Csharp:user WebControl Read Adobe PDF Files In Your Web Browser
阅读量:4561 次
发布时间:2019-06-08

本文共 2218 字,大约阅读时间需要 7 分钟。

namespace GeovinDu.PdfViewer{    [DefaultProperty("FilePath")]    [ToolboxData("<{0}:ShowPdf runat=server>
")] public class ShowPdf : WebControl { #region "Declarations" //Geovin Du 塗聚文 20131010 private string mFilePath;#endregion #region "Properties" [Category("Source File")] [Browsable(true)] [Description("Set path to source file.")] [Editor(typeof(System.Web.UI.Design.UrlEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FilePath { get { return mFilePath; } set { if (value == string.Empty) { mFilePath = string.Empty; } else { int tilde = -1; tilde = value.IndexOf('~'); if (tilde != -1) { mFilePath = value.Substring((tilde + 2)).Trim(); } else { mFilePath = value; } } } } // end FilePath property#endregion #region "Rendering" /// /// Geovin Du 塗聚文 20131010 /// /// protected override void RenderContents(HtmlTextWriter writer) { try { StringBuilder sb = new StringBuilder(); sb.Append(""); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(sb.ToString()); writer.RenderEndTag(); } catch { // with no properties set, this will render "Display PDF Control" in a // a box on the page writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Display PDF Control"); writer.RenderEndTag(); } // end try-catch } // end RenderContents #endregion } // end class} // end namespace Geovin Du 塗聚文 20131010

 

转载于:https://www.cnblogs.com/geovindu/p/3361704.html

你可能感兴趣的文章
【NOIP1999】【Luogu1015】回文数(高精度,模拟)
查看>>
Linux上安装Python3.5
查看>>
crt安装
查看>>
git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git
查看>>
c++中static的用法详解
查看>>
转 我修改的注册表,但是程序运行起来,还是记着以前的
查看>>
图片轮播功能
查看>>
第六周小组作业:软件测试和评估
查看>>
debian(kali Linux) 安装net Core
查看>>
centos 7防火墙设置
查看>>
每日一小练——数值自乘递归解
查看>>
函数依赖的公理化系统
查看>>
rabbitmq学习(四):利用rabbitmq实现远程rpc调用
查看>>
侯捷C++学习(二)
查看>>
EasyPlayer RTSP Android安卓播放器修复播放画面卡在第一帧bug
查看>>
web项目中全局常量的添加
查看>>
搬运工程 启动!
查看>>
局部加权回归(LWR) Matlab模板
查看>>
Connect to the DSP on C6A8168/DM8168/DM8148 using CCS
查看>>
hibernate在使用getCurrentSession时提示no session found for current thread
查看>>