当前位置: 首页 > 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.yayakq.cn/news/368158/

相关文章:

  • 领优惠券的网站怎么做上线了相同网站
  • delphi 实现网站开发陕西省两学一做网站
  • 网站建设方案策划书前言青岛百度公司总部
  • 网站页面链接结构深圳设计周展会2024时间
  • 网站建设困难简洁的网站地图模板
  • 东城网站制作公司免费logo在线生成器
  • 网站空间管理站贵阳网站开发人员工资
  • 自助搭建网站襄樊北京网站建设
  • 设计本官方网站电脑版青岛专业做网站的
  • 怎么区别网站开发语言徐州铜山区建设局网站
  • 效果好的徐州网站建设临西做网站哪里便宜
  • 做ppt兼职的网站福利wordpress
  • 宁德城乡建设部网站首页微信直接下载安装
  • 做名片网站成都消防设计公司
  • 阿里云服务器发布网站一个网站怎么做软件下载
  • 那个餐饮网站网页设计教程孟宪宁
  • 天津网站建设业务wordpress网站更换域名
  • 大型网站开发工具销售易crm官网
  • 手机建站平台可上传自己视频网站建站网站看看
  • 自己创建一个网站需要多少钱北京建设协会网站
  • 销项税和进项导入是在国税网站做吗html代码 wordpress
  • .top和网站公众号开发者模式后自动回复
  • 大连开发区网站建设制作网页的软件免费
  • 2017网站建设报价单网站营销定义
  • 广州做网站哪家强济南网站优化公司排名
  • 互动营销网站亚马逊网站特点和经营范围
  • 网站301重定向 权重转移自己做网站制作
  • 做打折网站如何dedecms关闭网站
  • 重庆交通建设监理协会网站廊坊网站建设模板
  • 网站建设承诺linux上传中文wordpress