html转pdf 格式不变
来源:互联网 发布:41478 网络电视直播 编辑:程序博客网 时间:2024/05/16 15:48
需要现在服务器安装 abcpdf
下载地址
先 using WebSupergoo.ABCpdf7;
string fileToSave = System.Web.HttpContext.Current.Server.MapPath("pdf保存路径"); Doc theDoc = new Doc(); XSettings.License = "XXX";//许可号 应该可以不填 theDoc.Font = theDoc.AddFont("宋体"); /* theDoc.MediaBox.String = "0 0 590 840"; double w = theDoc.MediaBox.Width; double h = theDoc.MediaBox.Height; double l = theDoc.MediaBox.Left; double b = theDoc.MediaBox.Bottom; //要是横着打印就注解下面代码 // theDoc.Transform.Rotate(90, 1, b); // theDoc.Transform.Translate(w, 0); // rotate our rectangle theDoc.Rect.Width = h; theDoc.Rect.Height = w; */ // add some text theDoc.Rect.Inset(15, 0); string pageBreak = "<div style=\"page-break-before:always\"> </div> "; string content = Literal1.Text.ToString(); content += pageBreak ; int theID = theDoc.AddImageHtml(content); while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } theDoc.SetInfo(theID, "/Rotate", "90"); theDoc.Save(fileToSave); theDoc.Dispose(); //--------------------------------------------------- Response.ContentType = "Application/pdf"; // string FilePath = pdfFile; Response.WriteFile(fileToSave); Response.End(); HttpContext.Current.ApplicationInstance.CompleteRequest();
- html转pdf 格式不变
- html格式转pdf格式
- pdf转换成html格式怎么转
- HTML转换为PDF格式
- PDF格式和HTML,XML格式
- Jasperreport 输出pdf格式和html格式
- 要将pdf转换成html格式该怎么转
- pdf转换成html格式怎么转的
- java String转Date类型 格式不变
- word格式转pdf格式
- 转换HTML内容为PDF格式
- HTML内容转换为PDF格式------java
- Markdown导出成HTML,PDF格式
- 转换 HTML 与 PDF 格式文档
- PDF转换成html格式的操作方法
- 如何将PDF转成HTML格式
- pdf转换成html格式的步骤
- pdf文件怎么转换成html格式
- vs2010编译错误之一
- 如何在Xcode里面运行C语言程序---简单展示
- 导出csv
- Cacti完全使用手册 ( 让你快速个性化使用Cacti )
- 编写CppUnit测试用例
- html转pdf 格式不变
- 09-Scrum过程-评审会(Review Meeting) & 反思会(Retrospective Meeting)
- local_irq_save与local_irq_disable
- 关注的 网易公开课
- 基于MFC的Cppunit测试用例编写步骤
- MYSQL创建utf-8格式的数据库
- 01-Scrum 概述 ,02-橄榄球 VS 软件,03-Scrum敏捷方法一分钟扫盲 ,04-Scrum敏捷方法中的工作产品 ,05-Scrum敏捷方法中的角色,06-Scrum过程-创建和维护产品
- Jquery 放大镜效果
- 一些英文