itextSharp 对pdf的每个页面添加footer/header
摘要:1 static void SetAllHeaderFooter(string inputPath) 2 { 3 4 PdfReader reader=new PdfReader(inputPath); 5 PdfStamper...
阅读全文
posted @
2014-06-28 12:55
极简
阅读(1452)
推荐(0) 编辑
itextSharp 使用模板(PdfTemplate)不规则分栏(ColumnText)
摘要:1 public static void Main() 2 { 3 4 Document document = new Document(); 5 BaseFont bf = BaseFont.createFont(Base...
阅读全文
posted @
2014-06-28 12:55
极简
阅读(527)
推荐(0) 编辑
wkhtmltopdf 生成pdf
摘要:1 public class PdfHelper 2 { 3 4 static string RootPath 5 { 6 get 7 { 8 string AppPat...
阅读全文
posted @
2014-06-28 12:55
极简
阅读(582)
推荐(0) 编辑
ean128与code128 条形码 算法分析
摘要:【code128条形码组成】除终止符(STOP)由13个模块组成外,其他字符均由11个模块组成就是说,如果用‘1’表示黑线(实模块),用‘0’表示白线(空模块),那么每表示一个字符就需要11条线,也就是11个模块。在条码字符中,每三个条和三个空组成一个字符,终止符有四个条和三个空组成。就是说,这11...
阅读全文
posted @
2014-06-28 12:54
极简
阅读(4508)
推荐(0) 编辑
SMTP命令 发送邮件 DOS命令
摘要:1.实例:从qq邮箱 发送到其他地址的邮箱>telnet smtp.qq.com 25>helo qq.com>auth login>NzI3MTU0MTg3QHFxLmNvbQ== (邮箱名的base64编码 http://tool.chinaz.com/Tools/base64.aspx)>。。...
阅读全文
posted @
2014-06-27 14:04
极简
阅读(3256)
推荐(0) 编辑
isotope/masonry 使用jQuery.sortable
摘要:1 function goMasonry() { 2 // if ($container.data('masonry') != undefined) { 3 $container.isotope('destroy'...
阅读全文
posted @
2014-06-27 13:57
极简
阅读(395)
推荐(0) 编辑
Spring.Net Aop
摘要:Spring.Net 有四种通知:IMethodBeforeAdvice,IAfterReturningAdvice,IMethodInterceptor,IThrowsAdviceBeforeAdvice 1 using System.Reflection; 2 using Spring.Aop; 3 public class BeforeAdvice : IMethodBeforeAdvice 4 { 5 public void Before(MethodInfo method , object[] args , object target...
阅读全文
posted @
2013-03-16 15:53
极简
阅读(567)
推荐(0) 编辑
Spring.Net Ioc 实例
摘要:配置文件 import.xml 1 <?xml version="1.0" encoding="utf-8" ?> 2 <objects xmlns="http://www.springframework.net" xmlns:aop="http://www.springframework.net/aop"> 3 4 <!--带参数的构造函数--> 5 <object id="HelloWorld1" type="IocApp.HelloWor
阅读全文
posted @
2013-03-16 15:53
极简
阅读(264)
推荐(0) 编辑
Nbear讲解 之核心类CodeGenerator
摘要:以下是CodeGenerator类用的一些辅助类:Cmp比较类型 1 /// <summary> 2 /// Cmp 3 /// </summary> 4 public enum Cmp 5 { 6 /// <summary> 7 /// LessThan 8 /// </summary> 9 LessThan,10 /// <summary>11 /// EqualTo12 /// </summary>13 EqualTo,14 ...
阅读全文
posted @
2013-03-16 15:52
极简
阅读(398)
推荐(0) 编辑
持久层框架:Db4objects [Db4objects.Db4o.dll]
摘要:DBContext 1 public class DBContext 2 { 3 private static IObjectContainer _db; 4 public static IObjectContainer DB 5 { 6 get 7 { 8 if (_db == null) 9 {10 11 _db = Db4oFactory.OpenFile(Path);12 }13 ...
阅读全文
posted @
2012-12-09 14:16
极简
阅读(464)
推荐(0) 编辑
条形码 BarCode (C# BarcodeLib.dll)
摘要:1 static void BuildBarcode()2 {3 System.Drawing.Image image;4 int width=250, height=100;5 byte[] buffer = GetBarcode(height, width, 6 BarcodeLib.TYPE.CODE128, "Avx-(13614)-vR", out image);7 } 1 static byte[] GetBarcode(int he...
阅读全文
posted @
2012-11-16 21:36
极简
阅读(9792)
推荐(2) 编辑
iTextSharp 生成pdf Form 实例
摘要:使用Adobe acrobat Pro先手工做一个Pdf Form的模板:1.新建:,选择新建/Pdf form file(Ctrl+N), 可以选择先有的某些类型的文件作为最处的模板,选择一个文件后(例如.txt的),就新建好了.2.编辑:选择右边的工具栏,选择Content/Edit Docum...
阅读全文
posted @
2012-11-16 21:36
极简
阅读(1326)
推荐(1) 编辑
iTextSharp 生成PDF 实例
摘要:1 static void Main(string[] args) 2 { 3 //CreatePDF 4 string name=Guid.NewGuid().ToString("N"); 5 Doc...
阅读全文
posted @
2012-11-16 21:35
极简
阅读(710)
推荐(0) 编辑
Excel[.xls|.xlsx|.csv] 导入 导出
摘要:程序集1 using System.IO;2 using System.Data;3 using System.Data.OleDb;4 using System.Data.Odbc;导入[.xls|.xlsx] 1 public static DataTable FromExceFile(string pathName) 2 { 3 DataSet ds = new DataSet(); 4 try 5 { 6 7 FileInfo file = new FileInf...
阅读全文
posted @
2012-11-16 21:34
极简
阅读(1266)
推荐(0) 编辑
iTextSharp 使用详解(转)
摘要:PDF文件是目前比较流行的电子文档格式,在办公自动化(OA)等软件的开发中,经常要用到该格式,但介绍如何制作PDF格式文件的资料非常少,在网上搜来搜去,都转贴的是同一段“暴力”破解的方法,代码片断如下: StreamWriter pPDF=new StreamWriter(filePath); ArrayList xRefs=new ArrayList(); float yPos =0f; long streamStart=0; long streamEnd=0; long streamLen =0; string strPDFMessage=null; //PDF文档头信息 strPDFMe
阅读全文
posted @
2012-11-11 20:25
极简
阅读(518)
推荐(0) 编辑
QQwry.dat 数据结构 存储结构 解析[C#代码]
摘要:存储格式: A.文件头(大小8字节), B.记录区(不定长),C.索引区(大小由文件头决定)A.文件头是8个字节长度,前四个字节存储了第一条索引的绝对地址, 后四个字节存储了最后一条索引的绝对地址。 (2^32字节=4GB)B.记录的格式是[IP地址][国家记录][地区记录]: ip:4字节, 国家记录(字符串,0结尾), 地区记录(字符串,0结尾) [字段形式] 国家名或者地区名,我们就有了两个可能: 第一就是直接的字符串表示的国家名, 第二就是一个4字节的结构, 第一个字节表明了重定向的模式, 后面3个字节是国家名或者地区名的实际偏移位置(指针)。 [重定向的模式]有两种:0x01、0..
阅读全文
posted @
2012-11-11 13:10
极简
阅读(961)
推荐(0) 编辑
使用HTML Help Workshop将HTML转为CHM
摘要:使用HTML Help Workshop编译成CHM文件需要如下三个文件,分别以hhp,hhc,hhk为文件后缀名。hhp:CHM工程文件,CHM目标文件属性参数在这里配置.hhc,列表文件,确定目标文件中左侧树形列表中"目录"选项卡下的内容.hhk,索引文件,确定目标文件中左侧树形列表中"索引"选项卡下的内容.[hhp文件]hhp几乎就是一个标准的ini文件.分为三个小节Option,Windows,Files.典型的配置文件(hhp)结构如下:test.hhp[OPTIONS]Compatibility=1.1 Or laterDefault win
阅读全文
posted @
2012-11-11 13:09
极简
阅读(1685)
推荐(0) 编辑
社交网站 分享 +button
摘要:A.Share【twitter】 https://twitter.com/intent/tweet? text=Peter+en+de+wolf+in+het+Stadstheater+Zoetermeer &url=http%3A%2F%2Fbit.ly%2Fxrf0f0 <p><a href="http://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a></p> <p><a href="http://tw
阅读全文
posted @
2012-10-22 15:14
极简
阅读(362)
推荐(0) 编辑
地图 查经纬度 算距离
摘要:A.计算两点距离public const double EarthRadiusKm = 6378.137; // WGS-84 public double GetDistance(double p1Lat, double p1Lng, double p2Lat, double p2Lng){ double dLat1InRad = p1Lat * (Math.PI / 180); double dLong1InRad = p1Lng * (Math.PI / 180); double dLat2InRad = p2Lat * ...
阅读全文
posted @
2012-10-22 14:49
极简
阅读(773)
推荐(0) 编辑