91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 18.02MB
    文件類(lèi)型: .zip
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-08-02
  • 語(yǔ)言: 其他
  • 標(biāo)簽: net、C#??

資源簡(jiǎn)介

1、創(chuàng)建PDF文檔,加密創(chuàng)建的PDF文檔, 2、使用第三方組件創(chuàng)建PDF文檔,修飾PDF文檔, 3、轉(zhuǎn)換PDF文檔

資源截圖

代碼片段和文件信息

using?System;
using?System.Data;
using?System.Configuration;
using?System.Collections;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.Data.Sql;
using?System.Data.SqlClient;
using?iTextSharp;
using?iTextSharp.text;
using?iTextSharp.text.pdf;
using?System.IO;

public?partial?class?_Default?:?System.Web.UI.Page?
{
????//定義表
????static?DataTable?mytable?=?new?DataTable(“temppdf“);
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????if?(!Page.IsPostBack)
????????{
????????????//設(shè)計(jì)表結(jié)構(gòu)
????????????DataColumn?col1?=?new?DataColumn(“Names“?typeof(System.String));
????????????DataColumn?col2?=?new?DataColumn(“Sex“?typeof(System.String));
????????????DataColumn?col3?=?new?DataColumn(“Age“?typeof(System.Int32));
????????????DataColumn?col4?=?new?DataColumn(“JG“?typeof(System.String));
????????????DataColumn?col5?=?new?DataColumn(“Phone“?typeof(System.String));
????????????DataColumn?col6?=?new?DataColumn(“Address“?typeof(System.String));
????????????//將創(chuàng)建的列添加到數(shù)據(jù)表當(dāng)中
????????????mytable.Columns.Add(col1);
????????????mytable.Columns.Add(col2);
????????????mytable.Columns.Add(col3);
????????????mytable.Columns.Add(col4);
????????????mytable.Columns.Add(col5);
????????????mytable.Columns.Add(col6);
????????}
????}
????protected?void?Button1_Click(object?sender?EventArgs?e)
????{
????????//創(chuàng)建表的一行數(shù)據(jù)
????????DataRow?myrow?=?mytable.NewRow();
????????//添加行數(shù)據(jù)信息
????????myrow[“Names“]?=?TextBox1.Text;
????????myrow[“Sex“]?=?TextBox2.Text;
????????myrow[“Age“]?=?TextBox3.Text;
????????myrow[“JG“]?=?TextBox4.Text;
????????myrow[“Phone“]?=?TextBox5.Text;
????????myrow[“Address“]?=?TextBox6.Text;
????????mytable.Rows.Add(myrow);
????????//將表格數(shù)據(jù)轉(zhuǎn)換成PDF文檔
????????ConverToPdf(mytable?Server.MapPath(“.“)?+?@“\temptable.pdf“?“c:\\WINDOWS\\FONTS\\SIMLI.TTF“?15);
????????this.Page.RegisterStartupscript(“ss“?“ript>alert(‘PDF文檔成功保存!‘)ript>“);
????}
????///?
????///?將表格轉(zhuǎn)換成PDF文檔的方法
????///?

????///?表對(duì)象
????///?PDF文檔的保存路徑
????///?字體路徑
????///?字體大小
????///?
????public?static?bool?ConverToPdf(DataTable?datatable?string?PDFPaths?string?FontPath?float?FontSize)
????{
????????//初始化一個(gè)文檔類(lèi)
????????Document?document?=?new?Document();
????????//調(diào)用PDF的寫(xiě)入方法流
????????PdfWriter?writer?=?PdfWriter.GetInstance(document?new?FileStream(PDFPaths?FileMode.Create));
????????document.Open();????????????//打開(kāi)文檔
????????//創(chuàng)建PDF文檔中的字體
????????baseFont?basefont?=?baseFont.CreateFont(FontPath?baseFont.IDENTITY_H?baseFont.NOT_embedDED);
????????Font?font?=?new?Font(basefont?FontSize);
????????//創(chuàng)建一個(gè)PDF格式的表
????????PdfPTable?table?=?new?PdfPTable(datatable.Columns.Count);
????????//遍歷表中的內(nèi)容
?????

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2012-07-30?21:56??第12章\
?????目錄???????????0??2012-07-30?21:56??第12章\使用瀏覽器打開(kāi)PDF文檔\
?????目錄???????????0??2012-07-30?21:56??第12章\使用瀏覽器打開(kāi)PDF文檔\App_Data\
?????文件?????3567616??2009-09-15?14:41??第12章\使用瀏覽器打開(kāi)PDF文檔\App_Data\itextsharp.dll
?????目錄???????????0??2012-07-30?21:56??第12章\使用瀏覽器打開(kāi)PDF文檔\Bin\
?????文件?????3567616??2009-09-15?14:41??第12章\使用瀏覽器打開(kāi)PDF文檔\Bin\itextsharp.dll
?????文件??????????48??2010-04-16?14:13??第12章\使用瀏覽器打開(kāi)PDF文檔\Bin\itextsharp.dll.refresh
?????文件????????3853??2010-04-28?21:14??第12章\使用瀏覽器打開(kāi)PDF文檔\ShowPDF.aspx
?????文件????????4089??2010-04-16?14:41??第12章\使用瀏覽器打開(kāi)PDF文檔\ShowPDF.aspx.cs
?????文件???????20317??2011-04-28?21:20??第12章\使用瀏覽器打開(kāi)PDF文檔\temptable.pdf
?????文件????????1825??2011-04-22?08:15??第12章\使用瀏覽器打開(kāi)PDF文檔\web.config
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建PDF文檔\
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建PDF文檔\App_Data\
?????文件?????3567616??2009-09-15?14:41??第12章\使用第三方組件創(chuàng)建PDF文檔\App_Data\itextsharp.dll
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建PDF文檔\Bin\
?????文件?????3567616??2009-09-15?14:41??第12章\使用第三方組件創(chuàng)建PDF文檔\Bin\itextsharp.dll
?????文件??????????48??2010-04-16?09:19??第12章\使用第三方組件創(chuàng)建PDF文檔\Bin\itextsharp.dll.refresh
?????文件????????2303??2010-04-27?11:14??第12章\使用第三方組件創(chuàng)建PDF文檔\CreatePdf.aspx
?????文件????????1005??2010-04-27?13:03??第12章\使用第三方組件創(chuàng)建PDF文檔\CreatePdf.aspx.cs
?????文件?????????634??2010-04-28?22:18??第12章\使用第三方組件創(chuàng)建PDF文檔\Default.aspx
?????文件????????5618??2011-06-23?17:04??第12章\使用第三方組件創(chuàng)建PDF文檔\Default.aspx.cs
?????文件????????1825??2011-04-22?08:14??第12章\使用第三方組件創(chuàng)建PDF文檔\web.config
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\
?????目錄???????????0??2012-08-29?14:48??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\App_Code\
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\App_Data\
?????文件?????3567616??2009-09-15?14:41??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\App_Data\itextsharp.dll
?????目錄???????????0??2012-07-30?21:56??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\Bin\
?????文件?????3567616??2009-09-15?14:41??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\Bin\itextsharp.dll
?????文件??????????48??2010-04-16?09:19??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\Bin\itextsharp.dll.refresh
?????文件????????2303??2010-04-27?11:14??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\CreatePdf.aspx
?????文件????????1198??2010-04-29?12:22??第12章\使用第三方組件創(chuàng)建支持中文的PDF文檔\CreatePdf.aspx.cs
............此處省略48個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源