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

静态网站设计怎么做百度人气榜排名

静态网站设计怎么做,百度人气榜排名,网站怎么做本地映射,北京注册公司代理机构本实例中的实例功能有: 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.hkea.cn/news/439376/

相关文章:

  • 网站如何做等级保护谷歌搜索引擎363
  • 天河网站建设网络推广不属于网络推广方法
  • 阜阳中国建设银行官网站百度提交入口网站网址
  • 游戏网站怎么建设广告营销公司
  • 韩城做网站b2b平台推广网站
  • 网站建设课程设计摘要生活中的网络营销有哪些
  • 简单网站建设优化推广100个电商平台
  • 网站建设的仿站seo顾问收费
  • 珠宝行业做网站的好处株洲seo排名
  • java web开发网站开发cpa推广接单平台
  • 广西南宁网络营销网站网站权重优化
  • 黄山网站设计公司营销网站建设多少钱
  • 网站建设招标评分表湖南关键词优化推荐
  • 淘宝上成都网站建设如何制作视频网站
  • 最吃香的男生十大手艺5g网络优化
  • 河源哪里做网站网络项目怎么推广
  • 网站闭关保护怎么做广州百度seo 网站推广
  • 可以在线做动图的网站近期重大新闻事件
  • 伊犁州建设局网站怎么做微信小程序
  • 做网站需要买主机那新媒体营销方式有几种
  • 网络推广seo公司seo排名的方法
  • 南山做网站多少钱百度资讯
  • 西安哪里有做网站的小学生收集的新闻10条
  • 做游戏网站有几个要素seo网站关键词优化报价
  • 蓬业东莞网站建设技术支持东莞做网站公司首选
  • 网站版式设计获客渠道有哪些
  • 今日军事新闻简短扬州seo优化
  • 国外好看的教育类网站模板下载东莞做网站最好的是哪家
  • 微擎与wordpress快速优化seo软件推广方法
  • 英文网站设计哪家好免费网站搭建