当前位置: 首页 > news >正文

wordpress邮箱宁波seo网络推广外包报价

wordpress邮箱,宁波seo网络推广外包报价,wordpress主题 苏醒,昆明有多少做网站的公司本实例中的实例功能有: 1、 Aspose.Words.dll 插入模板指定域替换为文字或html标签,见1 2、Aspose.Words.dll 插入模板表格,使用的是邮件合并MailMerge功能,数据源是DataTable或List对象(将list转换成DataTable),见1和2 3、word转换Pdf文件,见1 4、将多个word输出文…

本实例中的实例功能有: 

1、 Aspose.Words.dll 插入模板指定域替换为文字或html标签,见1

2、Aspose.Words.dll 插入模板表格,使用的是邮件合并MailMerge功能,数据源是DataTable或List对象(将list转换成DataTable),见1和2

3、word转换Pdf文件,见1

4、将多个word输出文档合并成一个文档 ,见1

5、请求API 接口查询JSON数据 ,见3

6、翻页查询,T-SQL方法见2

1、准备工作:word模板,插入域

域插入方法:

1.1>WPS添加域,插入>>文档部件>>域>>邮件合并,见图一

1.2> Office Word添加域,插入>>文档部件>>域>>MergeField,见图二

2、效果图

3、Aspose.Words封装类:

using Aspose.Words;
using Aspose.Words.MailMerging;
using Aspose.Words.Saving;
using DS_SCZX.Common;
using DS_SCZX.Entities;
using DS_SCZX.Entities.GetObj;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;namespace DS_SCZX.BLL
{/// <summary>/// AsposeWordHelper插件的业务逻辑层/// </summary>public class AsposeWordHelper{readonly string key = "this your key";public AsposeWordHelper(){#region  许可证Aspose.Words.License license = new Aspose.Words.License();//签名license.SetLicense(new MemoryStream(Convert.FromBase64String(key)));#endregion}/// <summary>/// Word转PDF/// Author:Bingo/// Date:2024-07-31/// </summary>/// <param name="wordPath">word绝对路径</param>/// <param name="PDFPath">pdf要保存的绝对路径</param>/// <returns></returns>public MessageInfo WordToPDF(string wordPath, string PDFPath){var result = new MessageInfo();result.success = false;result.msg = "";if (string.IsNullOrEmpty(wordPath)){result.msg = "word路径不能为空";return result;}File.Exists(wordPath);if (!File.Exists(wordPath)){result.msg = "word文件不存在";return result;}//不带扩展名称的文件名称string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(wordPath);新合格证保存路径//string filePathTem = $@"C:\Codes\DS_SCZX\DS_SCZX\WordPDFiles\{fileNameWithoutExtension}.pdf";try{#region  实现Word转PDFAspose.Words.Document doc = new Aspose.Words.Document(wordPath);PdfSaveOptions options = new PdfSaveOptions();options.Compliance = PdfCompliance.Pdf17;// Convert Word to PDFdoc.Save(PDFPath, options);#endregionresult.msg = $@"/WordPDFiles/" + fileNameWithoutExtension + ".pdf";result.success = true;}catch (Exception ex){result.msg = ex.Message;}return result;}/// <summary>/// 合并word文档/// </summary>/// <param name="wordPaths">文档路径数组</param>/// <param name="outputPath">合并后的文件保存路径</param>public bool CombineWord(List<string> ListDocPath, string outputPath){bool b = false;try{Document mergedDocument = new Document(ListDocPath.FirstOrDefault());// 遍历要合并的文档路径for (int i = 1; i < ListDocPath.Count; i++){Document doc = new Document(ListDocPath[i]);mergedDocument.AppendDocument(doc, ImportFormatMode.UseDestinationStyles);}//保存文档mergedDocument.Save(outputPath);}catch (Exception){b = false;throw;}return b;测试合并文档//Document doc = new Document(wordItemUrl_out); //Document doc2 = new Document(wordItemUrl_out2);合并//doc.AppendDocument(doc2, ImportFormatMode.UseDestinationStyles);//string wordItemUrl_outALL = Server.MapPath($@"~/DownFiles/试验计划模板20240704/merged_document.docx");保存文档//doc.Save(wordItemUrl_outALL);}/// <summary>/// 将dataTable数据插入word文档/// Author:Bingo/// Date:2024-07-31/// </summary>/// <param name="wordPath">word模板文件路径</param>/// <param name="wordItemUrl2">word输出路径</param>/// <param name="dt2">数据源</param>/// <returns></returns>public MessageInfo InsertTable(string wordPath, string wordItemUrl2, DataTable dt2){var result = new MessageInfo();result.success = false;result.msg = "";if (string.IsNullOrEmpty(wordPath)){result.msg = "word模板路径不能为空";return result;}File.Exists(wordPath);if (!File.Exists(wordPath)){result.msg = "word模板文件不存在";return result;}try{#region  插入表数据Aspose.Words.Document doc = new Aspose.Words.Document(wordPath);Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);builder.MoveToMergeField("FirstTitle");builder.Write("01烧结-test");builder.MoveToMergeField("SecondTitle");builder.Wr
http://www.tj-hxxt.cn/news/53777.html

相关文章:

  • 温州网站建设推荐广州seo招聘信息
  • wordpress 垃圾评论seo优化服务是什么
  • 可以免费做兼职的网站有哪些安卓优化大师旧版本下载
  • 外链博客网站运营怎么做
  • 平面设计师工作内容关键词优化的发展趋势
  • 做网站申请域名的流程企业整站优化
  • wordpress订阅邮箱正规的关键词优化软件
  • 企业做网站的作用一媒体app软件下载老版本
  • 在线企业查询系统杭州seo排名
  • 佛山做网站哪家好seo霸屏
  • 多少钱日语优化网站内容
  • 株洲有名的网站天津网络广告公司
  • 电子商务网站建设与原理关键词搜索爱站
  • 怎么制作网站app360网站收录提交
  • 大型做网站公司推特最新消息今天
  • 做网站条件网络营销产品策略分析
  • 手机建站系统源码螺蛳粉营销策划方案
  • jquery 单击input输入框弹出选择框多用于人才类网站怎么推广产品
  • 门户网站 建设商 排名企业网站设计服务
  • 西安网站建设优化服务公司如何推广自己的产品
  • html5新闻网站模板小米市场营销案例分析
  • 专业微网站建设竞价排名的服务模式是
  • 分类目录网站做排名全国推广优化网站
  • 网站建设app哪个好用seo排名哪家有名
  • 石家庄高端网站建设淘数据
  • 怎么做hello官方网站google官网入口注册
  • 个人做网站需要注意什么搜索网站排行
  • 网站日志如何分析如何推广网店
  • 哪些网站结构是不合理的国外网站加速
  • 建设网站费用多少钱百度竞价入门教程