All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Apache指南- .htaccess文件使用手册_[PHP教程]
ASP.NET,AJAX中的异步Web,Services调用_[Asp.Net教程]
ASP.NET2.0学习历程,菜鸟到中级程序员的飞跃--30本好书点评_[Asp.Net教程]
sql,server,2005中新增的bulk功能_[SQL,Server教程]
在ASP.NET里得到网站的域名_[Asp.Net教程]
PHP代码:基本数据结构和php内置函数_php资料_编程技术
[delphi语法7]delphi中While语句的使用实例
PHP实例:实现文件上传的程序源码_[PHP教程]
Asp.net生成htm静态文件的两种途径_.net资料_编程技术
合理使用HTML标签进行CSS布局_[Html教程]
Reading number is top 10 pictures
Sora aoi on twitter4
西班牙山村小景2
Summer is most suitable for young people to travel in China6
徐若瑄展示美丽胸围3
photos of ashlynn brooke(ashlynn brooke的美图)
The service WaLiangGe Chinese aircraft carrier1
Soong ching ling's former residence2
From China fortress sora aoi2
网上疯传的一篇小学作文《爸爸也治不了妈妈》
XuRe xuan cool and refreshing photoes2
Download software ranking
Take off clothes to survival
致我们终将逝去的青春
圣殿祭司的ASP.NET.2.0.开发详解-使用C#
Unix video tutorial7
软件工程思想
apache-tomcat-6.0.33
Tram sex maniac 2 (H) rar bag5
Ashlynn Video2
中国结婚习俗实录
C++编程教程第三版
delv published in(发表于) 2014/1/10 6:32:40 Edit(编辑)
生成pdf文件的好东西,itextsharp_[Asp.Net教程]

生成pdf文件的好东西,itextsharp_[Asp.Net教程]

生成pdf文件的好东西,itextsharp_[Asp.Net教程]

官网:
http://sourceforge.net/projects/itextsharp/
http://hardrock.cnblogs.com/
http://www.rubypdf.com/

现在的版本是3.18版,记得在引用里导入itextsharp.下面的代码是把图象合并到一个多页pdf的例子.


private void process(string[] files, string newpdf)
{
iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);


try
{
iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(newpdf, FileMode.Create, FileAccess.ReadWrite));


document.Open();
iTextSharp.text.Image image;
for (int i = 0; i < files.Length; i++)
{
image = iTextSharp.text.Image.GetInstance(files[i]);

if (image.Height > iTextSharp.text.PageSize.A4.Height - 25)
{
image.ScaleToFit(iTextSharp.text.PageSize.A4.Width - 25, iTextSharp.text.PageSize.A4.Height - 25);
}
else if (image.Width > iTextSharp.text.PageSize.A4.Width - 25)
{
image.ScaleToFit(iTextSharp.text.PageSize.A4.Width - 25, iTextSharp.text.PageSize.A4.Height - 25);
}
image.Alignment = iTextSharp.text.Image.ALIGN_MIDDLE;
//image.SetDpi(72, 72);


document.NewPage();
document.Add(image);

//Phrase phrase3 = new Phrase("dreign@163.com\n", FontFactory.GetFont(FontFactory.TIMES, 9, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(192, 192, 192)));
//document.Add(phrase3);
}
}
catch (Exception ioe)
{
MessageBox.Show(ioe.Message);
}
document.Close();
}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.