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

Word 转成pdf及打印的开源方案支持xp

Word转成pdf、打印的方案几乎没有免费开源的方案,现在提供一个通过LibreOffice实现的方案

操作依赖LibreOffice需要安装,点此下载老版本

5.4.7.2是最后一个支持xp的 版本如需xp要请安装此版本

LibreOffice官方介绍

LibreOffice 是一款开放源代码的自由免费全能办公软件,可运行于 Microsoft Windows, GNU/Linux 以及 macOS 等操作系统上。它包含了 Writer, Calc, Impress, Draw, Math 以及 Base 等组件,可分别用于文本文档、电子表格、幻灯片演示文稿、绘图文档、数学公式编辑、数据库管理等工作。

LibreOffice 采用对企业和个人用户均免费的 MPL 2.0 授权协议。您可以自由分发该软件,无需支付授权费用(但您仍然可以付费获得经认证的专业支持)。它的源代码完全公开,任何人都可以参与软件的开发和维护。

一、通过进程的方式

1.Word打印

  public void PrintWordFile(string file, string printerName){if (string.IsNullOrEmpty(file)) throw new Exception("Invalid parameters passed to convert word function.");if (!File.Exists(file)) throw new FileNotFoundException($"The file passed to the convert word process ({file}) could not be found.");var fileInfo = new FileInfo(file);if (fileInfo.Extension.ToLower() != ".doc" && fileInfo.Extension.ToLower() != ".docx")throw new ArgumentOutOfRangeException($"The file type passed to the convert word process is an invalid type ({fileInfo.Extension}).");var libreOfficePath = Path.Combine(LibreOfficePath, "swriter.exe");if (!File.Exists(libreOfficePath)) throw new FileNotFoundException("It seems that LibreOffice is not where it should be, please ensure the path exists.");var procStartInfo = new ProcessStartInfo(libreOfficePath, $@"--headless --pt ""{printerName}"" ""{file}"""){RedirectStandardOutput = true,RedirectStandardError = true,UseShellExecute = false,CreateNoWindow = true,WorkingDirectory = Environment.CurrentDirectory};Process process = new Process() { StartInfo = procStartInfo };// Attach event handlers to capture output and error streamsprocess.OutputDataReceived += (sender, args) => Console.WriteLine("OUT: " + args.Data);process.ErrorDataReceived += (sender, args) => Console.WriteLine("ERR: " + args.Data);process.Start();// Start reading the output asynchronouslyprocess.BeginOutputReadLine();process.BeginErrorReadLine();process.WaitForExit();if (process.ExitCode != 0){throw new LibreOfficeFailedException(process.ExitCode);}}

2.Word转成PDF

  public string ConvertWordFile(string file, string outputDirectory){if (string.IsNullOrEmpty(file) || string.IsNullOrEmpty(outputDirectory)) throw new Exception("Invalid parameters passed to convert word function.");if (!File.Exists(file)) throw new FileNotFoundException($"The file passed to the convert word process ({file}) could not be found.");if (!Directory.Exists(outputDirectory)) throw new DirectoryNotFoundException($"The output folder passed to the convert word process ({outputDirectory}) does not exist.");if (outputDirectory.EndsWith(@"\")) outputDirectory = outputDirectory.TrimEnd('\\');var fileInfo = new FileInfo(file);if (fileInfo.Extension.ToLower() == ".doc" && fileInfo.Extension.ToLower() == ".docx") throw new ArgumentOutOfRangeException($"The file type passed to the convert word process is an invalid type ({fileInfo.Extension}).");var outputFile = outputDirectory + @"\" + Path.GetFileNameWithoutExtension(fileInfo.Name) + ".pdf";if (File.Exists(outputFile)) File.Delete(outputFile);var libreOfficePath = Path.Combine(LibreOfficePath, "swriter.exe");if (!File.Exists(libreOfficePath)) throw new FileNotFoundException("It seems that LibreOffice is not where it should be, please ensure the path exists.");var procStartInfo = new ProcessStartInfo(libreOfficePath, $@"--headless --convert-to pdf:writer_pdf_Export ""{file}"" --outdir ""{outputDirectory}"""){RedirectStandardOutput = true,UseShellExecute = false,CreateNoWindow = true,WorkingDirectory = Environment.CurrentDirectory};Process process = new Process() { StartInfo = procStartInfo };process.Start();process.WaitForExit();if (process.ExitCode != 0)throw new LibreOfficeFailedException(process.ExitCode);if (!File.Exists(outputFile)) throw new FileNotFoundException("The convert to word process has failed to convert the file!");return outputFile;}public class LibreOfficeFailedException : Exception{public LibreOfficeFailedException(int exitCode) : base($"LibreOffice has failed with {exitCode}") { }}

二、通过cli库调用,下附代码

CLI下载

   public class WordPrint{private XComponentContext context;private XMultiServiceFactory service;private XComponentLoader component;private XComponent doc;private static WordPrint wordPrint;private List<string> filters = new List<string>();#region ConstructorsWordPrint(){NativeMethods.InitializationLibrary();/// This will start a new instance of OpenOffice.org if it is not running, /// or it will obtain an existing instance if it is already open.context = uno.util.Bootstrap.bootstrap();/// The next step is to create a new OpenOffice.org service managerservice = (XMultiServiceFactory)context.getServiceManager();/// Create a new Desktop instance using our service managercomponent = (XComponentLoader)service.createInstance("com.sun.star.frame.Desktop");// Getting filtersXNameContainer filters = (XNameContainer)service.createInstance("com.sun.star.document.FilterFactory");foreach (string filter in filters.getElementNames())this.filters.Add(filter);}~MiniWordPrint(){if (doc != null)doc.dispose();doc = null;}#endregion#region Private methodsprivate string FilterToString(ExportFilter filter){switch (filter){case ExportFilter.Word97: return "MS Word 97";case ExportFilter.WriterPDF: return "writer_pdf_Export";case ExportFilter.CalcPDF: return "calc_pdf_Export";case ExportFilter.DrawPDF: return "draw_pdf_Export";case ExportFilter.ImpressPDF: return "impress_pdf_Export";case ExportFilter.MathPDF: return "math_pdf_Export";}return "";}#endregion#region Public methods/// <summary>/// load docx/// </summary>/// <param name="filename">file path</param>/// <param name="hidden">load document invisible Defines if the loaded component is made visible. If this property is not specified, the component is made visible by default.</param>/// <returns></returns>public bool Load(string filename, bool hidden){return Load(filename, hidden, "", "");}/// <summary>/// load docx/// </summary>/// <param name="filename">file path</param>/// <param name="hidden">load document invisible Defines if the loaded component is made visible. If this property is not specified, the component is made visible by default. </param>/// <param name="filter_index">internal filter name <see cref="Filters"/> Filters index/// Name of a filter that should be used for loading or storing the component.Names must match the names of the TypeDetection configuration, invalid names are ignored.If a name is specified on loading, it still will be verified by a filter detection, but in case of doubt it will be preferred.</param>/// <param name="filter_options">additional properties for filter/// Some filters need additional parameters; use only together with property MediaDescriptor::FilterName.Details must be documented by the filter. This is an old format for some filters. If a string is not enough, filters can use the property MediaDescriptor::FilterData.</param>/// <returns></returns>public bool Load(string filename, bool hidden, int filter_index, string filter_options){return Load(filename, hidden, filters[filter_index], filter_options);}/// <summary>/// load docx/// </summary>/// <param name="filename">file path</param>/// <param name="hidden">load document invisible Defines if the loaded component is made visible. If this property is not specified, the component is made visible by default.</param>/// <param name="filter_name">internal filter name <see cref="Filters"/>/// Name of a filter that should be used for loading or storing the component.Names must match the names of the TypeDetection configuration, invalid names are ignored.If a name is specified on loading, it still will be verified by a filter detection, but in case of doubt it will be preferred.</param>/// <param name="filter_options"> additional properties for filter/// Some filters need additional parameters; use only together with property MediaDescriptor::FilterName.Details must be documented by the filter. This is an old format for some filters. If a string is not enough, filters can use the property MediaDescriptor::FilterData.</param>/// <returns></returns>public bool Load(string filename, bool hidden, string filter_name, string filter_options){List<PropertyValue> pv = new List<PropertyValue>();pv.Add(new PropertyValue("Hidden", 0, new uno.Any(hidden), PropertyState.DIRECT_VALUE));if (filter_name != ""){pv.Add(new PropertyValue("FilterName", 0, new uno.Any(filter_name), PropertyState.DIRECT_VALUE));pv.Add(new PropertyValue("FilterOptions", 0, new uno.Any(filter_options), PropertyState.DIRECT_VALUE));}try{doc = component.loadComponentFromURL("file:///" + filename.Replace('\\', '/'), "_blank",0, pv.ToArray());return true;}catch{doc = null;return false;}}/// <summary>///  a given document xDoc to print to the standard printer without any settings/// </summary>/// <returns></returns>public bool Print(){return Print("", 1, "");}/// <summary>/// a given document xDoc to print /// </summary>/// <param name="printName">string - Specifies the name of the printer queue to be used.</param>/// <param name="copies">short - Specifies the number of copies to print.</param>/// <param name="pages">string - Specifies the pages to print in the same format as in the print dialog of the GUI (e.g. "1, 3, 4-7, 9-")</param>/// <param name="orientation">com.sun.star.view.PaperOrientation. Specifies the orientation of the paper.</param>/// <param name="paperFormat">com.sun.star.view.PaperFormat. Specifies a predefined paper size or if the paper size is a user-defined size.</param>/// <returns></returns>public bool Print(string printName, int copies, string pages, MiniOrientation orientation = MiniOrientation.PORTRAIT, MiniFormat paperFormat = MiniFormat.A4){var printerDesc = new List<PropertyValue>();if (!string.IsNullOrEmpty(printName))printerDesc.Add(new PropertyValue("Name", 0, new uno.Any(typeof(string), printName), PropertyState.DIRECT_VALUE));printerDesc.Add(new PropertyValue("PaperOrientation", 0, new uno.Any(typeof(PaperOrientation), orientation), PropertyState.DIRECT_VALUE));printerDesc.Add(new PropertyValue("PaperFormat", 0, new uno.Any(typeof(PaperFormat), paperFormat), PropertyState.DIRECT_VALUE));var printOpts = new List<PropertyValue>();printOpts.Add(new PropertyValue("CopyCount", 0, new uno.Any(copies), PropertyState.DIRECT_VALUE));if (!string.IsNullOrEmpty(pages))printOpts.Add(new PropertyValue("Pages", 0, new uno.Any(pages), PropertyState.DIRECT_VALUE));printOpts.Add(new PropertyValue("Wait", 0, new uno.Any(true), PropertyState.DIRECT_VALUE));//if (doc is XPrintable)try{((XPrintable)doc).setPrinter(printerDesc.ToArray());((XPrintable)doc).print(printOpts.ToArray());return true;}catch { return false; }}/// <summary>/// a given document xDoc to print with custom/// </summary>/// <param name="printerDesc">///----------- Properties of com.sun.star.view.PrinterDescriptor--------///*** Name string - Specifies the name of the printer queue to be used.///*** PaperOrientation com.sun.star.view.PaperOrientation.Specifies the orientation of the paper.///*** PaperFormat com.sun.star.view.PaperFormat.Specifies a predefined paper size or if the paper size is a user-defined size.///*** PaperSize com.sun.star.awt.Size.Specifies the size of the paper in 1/100 mm.///*** IsBusy boolean - Indicates if the printer is busy.///*** CanSetPaperOrientation boolean - Indicates if the printer allows changes to.PaperOrientation///*** CanSetPaperFormat boolean - Indicates if the printer allows changes to.PaperFormat///*** CanSetPaperSize boolean - Indicates if the printer allows changes to.PaperSize/// </param>/// <param name="printerDesc">///------------- Properties of com.sun.star.view.PrintOptions--------///CopyCount short - Specifies the number of copies to print.///FileName string - Specifies the name of a file to print to, if set.///Collate boolean - Advises the printer to collate the pages of the copies.If true, a whole document is printed prior to the next copy, otherwise the page copies are completed together.///Pages string - Specifies the pages to print in the same format as in the print dialog of the GUI (e.g. "1, 3, 4-7, 9-")///Wait boolean - Advises that the print job should be performed synchronously, i.e.wait until printing is complete before returning from printing.Otherwise return is immediate and following actions(e.g.closing the corresponding model) may fail until printing is complete.Default is false./// </param>/// <param name="pagePrintSettings">/// ------------- Properties of com.sun.star.text.PagePrintSettings--------/// PageRows short - Number of rows in which document pages should appear on the output page./// PageColumns short - Number of columns in which document pages should appear on the output page./// LeftMargin long - Left margin on the output page./// RightMargin long - Right margin on the output page./// TopMargin long - Top margin on the output page./// BottomMargin long - Bottom margin on the output page./// HoriMargin long - Margin between the columns on the output page./// VertMargin long - Margin between the rows on the output page./// IsLandscape boolean - Determines if the output page is in landscape format./// </param>/// <returns></returns>public bool Print(List<MiniPropertyValue> printerDesc, List<MiniPropertyValue> printOpts, List<MiniPropertyValue> pagePrintSettings){try{var printSettings = pagePrintSettings.ConvertAll(v => ToPropertyValue(v));var desc = printerDesc.ConvertAll(v => ToPropertyValue(v));var opts = printOpts.ConvertAll(v => ToPropertyValue(v));((XPagePrintable)doc).setPagePrintSettings(printSettings.ToArray());((XPrintable)doc).setPrinter(desc.ToArray());((XPrintable)doc).print(opts.ToArray());return true;}catch { return false; }}/// <summary>/// save pdf/// </summary>/// <param name="filename">file path</param>/// <param name="filter"><see cref="ExportFilter"/></param>/// <returns></returns>public bool Save(string filename, ExportFilter filter){return Save(filename, FilterToString(filter));}/// <summary>/// save pdf/// </summary>/// <param name="filename">file path</param>/// <param name="filter">/// internal filter name <see cref="Filters"/>/// Name of a filter that should be used for loading or storing the component.Names must match the names of the TypeDetection configuration, invalid names are ignored.If a name is specified on loading, it still will be verified by a filter detection, but in case of doubt it will be preferred./// </param>/// <returns></returns>public bool Save(string filename, string filter){List<PropertyValue> pv = new List<PropertyValue>();pv.Add(new PropertyValue("FilterName", 0, new uno.Any(filter), PropertyState.DIRECT_VALUE));pv.Add(new PropertyValue("Overwrite", 0, new uno.Any(true), PropertyState.DIRECT_VALUE));try{filename = filename.Replace("\\", "/");((XStorable)doc).storeToURL("file:///" + filename, pv.ToArray());return true;}catch { return false; }}/// <summary>/// export pdf/// </summary>/// <param name="filename">file path</param>/// <returns></returns>public bool ExportToPdf(string filename){filename = Path.ChangeExtension(filename, ".pdf");bool ret = Save(filename, "writer_pdf_Export");if (!ret) ret = Save(filename, "impress_pdf_Export");if (!ret) ret = Save(filename, "calc_pdf_Export");if (!ret) ret = Save(filename, "draw_pdf_Export");if (!ret) ret = Save(filename, "impress_pdf_Export");if (!ret) ret = Save(filename, "math_pdf_Export");return ret;}/// <summary>/// close XComponent /// doc stream must be not use,otherwise dispose() has no return/// </summary>public void Close(){doc.dispose();doc = null;}/// <summary>///  new docx/// </summary>/// <param name="app"><see cref="AppType"/></param>/// <param name="hidden">load document invisible Defines if the loaded component is made visible. If this property is not specified, the component is made visible by default.</param>/// <returns></returns>public bool New(AppType app, bool hidden){try{string sapp = "private:factory/";switch (app){case AppType.Writer:sapp += "swriter";break;case AppType.Calc:sapp += "scalc";break;case AppType.Impress:sapp += "simpress";break;case AppType.Draw:sapp += "sdraw";break;case AppType.Math:sapp += "smath";break;}PropertyValue pv = new PropertyValue("Hidden", 0, new uno.Any(hidden), PropertyState.DIRECT_VALUE);doc = component.loadComponentFromURL(sapp, "_blank", 0, new PropertyValue[1] { pv });return true;}catch{doc = null;return false;}}#endregion#region Properties/// <summary>/// internal filter name/// Name of a filter that should be used for loading or storing the component.Names must match the names of the TypeDetection configuration, invalid names are ignored.If a name is specified on loading, it still will be verified by a filter detection, but in case of doubt it will be preferred./// </summary>public List<string> Filters{get { return filters; }}#endregionprivate PropertyValue ToPropertyValue(MiniPropertyValue miniProperty){return new PropertyValue(Name: miniProperty.Name,Handle: miniProperty.Handle,Value: new uno.Any(type: miniProperty.Value.Type,value: miniProperty.Value.Value),State: (PropertyState)miniProperty.State);}}

相关文章:

Word 转成pdf及打印的开源方案支持xp

Word转成pdf、打印的方案几乎没有免费开源的方案&#xff0c;现在提供一个通过LibreOffice实现的方案 操作依赖LibreOffice需要安装&#xff0c;点此下载老版本 5.4.7.2是最后一个支持xp的 版本如需xp要请安装此版本 LibreOffice官方介绍 LibreOffice 是一款开放源代码的自…...

LabVIEW软件侵权分析与应对

问&#xff1a;如果涉及到LabVIEW软件的仿制或模仿&#xff0c;特别是在功能、界面等方面&#xff0c;如何判断是否构成侵权&#xff1f;该如何应对&#xff1f; 答&#xff1a;LabVIEW软件的侵权问题&#xff0c;尤其是在涉及到仿制或模仿其功能、界面、设计等方面&#xff0…...

【redis】centos7下安装redis7

在CentOS 7下安装Redis7可以通过以下两种方法实现&#xff1a;手动编译安装和使用YUM进行安装。 CentOS 7系统的环境和版本&#xff1a; $ cat /etc/centos-release CentOS Linux release 7.9.2009 (Core)手动编译安装 参考官方文档&#xff1a;https://redis.io/docs/lates…...

[network]回顾:集线器(Hub)

集线器&#xff08;Hub&#xff09;的发明是计算机网络发展史上的一个重要里程碑。它最初的设计目的是为了解决局域网&#xff08;LAN&#xff09;中多台计算机共享网络资源的需求。 #mermaid-svg-OAmOmKYGAXoglS5z {font-family:"trebuchet ms",verdana,arial,sans-…...

79 Openssl3.0 RSA公钥加密数据

1 引言 最近不小心用到了openssl3.0&#xff0c;项目中需要使用rsa非对称加解密算法&#xff0c;所以把openssl3.0使用公钥加密数据的函数调用摸了一遍。 之所以记录此篇文章&#xff0c;是因为网络上大多数是openssl3.0以前的版本的函数接口&#xff0c;而openssl3.0之后已经丢…...

EFCore HasDefaultValueSql (续2 HasComputedColumnSql)

前情&#xff1a;EFCore HasDefaultValueSql EFCore HasDefaultValueSql (续1 ValueGeneratedOnAdd)-CSDN博客 小伙伴在使用 HasDefaultValueSql 时&#xff0c;对相关的 ValueGeneratedOnAdd, HasComputedColumnSql 也有了疑问&#xff1a; HasComputedColumnSql 对于计算…...

阿里巴巴TransmittableThreadLocal使用指南

前言 ThreadLocal在上下文的数据传输上非常的方便和简洁。工业实践中&#xff0c;比较常用的有三个&#xff0c;ThreadLocal、InheritableThreadLocal、TransmittableThreadLocal&#xff0c;那么他们三个之间有什么区别呢&#xff1f; 常见的三种ThreadLocal比较 ThreadLoc…...

ubuntu20下编译linux1.0 (part1)

author: hjjdebug date: 2025年 01月 09日 星期四 15:56:15 CST description: ubuntu20下编译linux1.0 (part1) 该博客记录了新gcc编译旧代码可能碰到的问题和解决办法, 可留作参考 操作环境: ubuntu20 $ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 $ as --vers…...

欧拉公式和傅里叶变换

注&#xff1a;英文引文机翻&#xff0c;未校。 中文引文未整理去重&#xff0c;如有异常&#xff0c;请看原文。 Euler’s Formula and Fourier Transform Posted byczxttkl October 7, 2018 Euler’s formula states that e i x cos ⁡ x i sin ⁡ x e^{ix} \cos{x} i …...

Jenkins内修改allure报告名称

背景&#xff1a; 最近使用Jenkins搭建自动化测试环境时&#xff0c;使用Jenkins的allure插件生成的报告&#xff0c;一直显示默认ALLURE REPORT&#xff0c;想自定义成与项目关联的名称&#xff0c;如图所示&#xff0c;很明显自定义名称显得高大上些&#xff0c;之前…...

30天开发操作系统 第 12 天 -- 定时器 v1.0

前言 定时器(Timer)对于操作系统非常重要。它在原理上却很简单&#xff0c;只是每隔一段时间(比如0.01秒)就发送一个中断信号给CPU。幸亏有了定时器&#xff0c;CPU才不用辛苦地去计量时间。……如果没有定时器会怎么样呢?让我们想象一下吧。 假如CPU看不到定时器而仍想计量时…...

Ubuntu | PostgreSQL | 解决 ERROR: `xmllint` is missing on your system.

解决 sudo apt install apt-file sudo apt-file updatesudo apt-file search xmllint sudo apt install libxml2-utils执行 # postgres源码安装包解压文件夹中 make install make install问题 make -C src install make[2]: Entering directory /home/postgres/postgresql-1…...

uniapp使用chooseLocation安卓篇

本文章全部以高德地图为例 代码 <view class"bottom"><button click"choose">定位</button> </view> choose() {uni.chooseLocation({success: function(res) {console.log(位置名称&#xff1a; res.name);console.log(详细地…...

《PC 上的开源神经网络多模态模型:开启智能交互新时代》

《PC 上的开源神经网络多模态模型&#xff1a;开启智能交互新时代》 一、引言二、多模态模型基础剖析&#xff08;一&#xff09;核心概念解读&#xff08;二&#xff09;技术架构探秘 三、开源多模态模型的独特魅力&#xff08;一&#xff09;开源优势尽显&#xff08;二&…...

Apache JMeter 压力测试使用说明

文章目录 一、 安装步骤步骤一 下载相关的包步骤二 安装 Jmeter步骤三 设置 Jmeter 工具语言类型为中文 二、使用工具2.1 创建测试任务步骤一 创建线程组步骤二 创建 HTTP 请求 2.2 配置 HTTP 默认参数添加 HTTP消息头管理器HTTP请求默认值 2.3 添加 查看结果监听器2.4 查看结果…...

腾讯云AI代码助手编程挑战赛-知识百科AI

作品简介 知识百科AI这一编程主要用于对于小朋友的探索力的开发&#xff0c;让小朋友在一开始就对学习具有探索精神。在信息化时代下&#xff0c;会主动去学习自己认知以外的知识&#xff0c;同时丰富了眼界&#xff0c;开拓了新的知识。同时催生了在大数据时代下的信息共享化…...

【SpringAOP】Spring AOP 底层逻辑:切点表达式与原理简明阐述

前言 &#x1f31f;&#x1f31f;本期讲解关于spring aop的切面表达式和自身实现原理介绍~~~ &#x1f308;感兴趣的小伙伴看一看小编主页&#xff1a;GGBondlctrl-CSDN博客 &#x1f525; 你的点赞就是小编不断更新的最大动力 &am…...

HTTP-响应协议

HTTP的响应过程&#xff1f; 浏览器请求数据--》web服务器过程&#xff1a;请求过程 web服务器将响应数据-》到浏览器&#xff1a;响应过程 响应数据有哪些内容&#xff1f; 1.和请求数据类似。 2. 响应体中存储着web服务器返回给浏览器的响应数据。并且注意响应头和响应体之间…...

SQL进阶实战技巧:即时订单比例问题

目录 0 需求描述 1 数据准备 2 问题分析 3 小结 往期精彩 0 需求描述 订单配送中,如果期望配送日期和下单日期相同,称为即时订单,如果期望配送日期和下单日期不同,称为计划订单。 请从配送信息表(delivery_info)中求出每个用户的首单(用户的第一个订单)中即时订单…...

什么是端口

端口是用来区分同一网络设备(IP地址)上运行的不同服务或应用程序接收外部数据的窗口。 以下是几个要点&#xff1a; 对于我们发送请求指定的url中的端口&#xff0c;指的是对方服务器的用于接收数据的端口&#xff0c;如http的80端口&#xff0c;服务器通常都会设定要监听来自…...

【Flutter】使用ScrollController配合EasyRefresh实现列表预加载:在还未滑动到底部时加载下一页数据

需求/背景 在我们的业务场景中&#xff0c;列表的加载使用easy_refresh组件&#xff1a; https://pub.dev/packages/easy_refresh 大概效果是往上滑动到一定的offset会触发一个上滑加载&#xff0c;可以触发一些网络请求拉取列表后面的数据来展示。 这种模式一般在一页翻完…...

【2025 Rust学习 --- 11 实用工具特型01】

清理特型Drop 当一个值的拥有者消失时&#xff0c;Rust 会丢弃&#xff08;drop&#xff09;该值。丢弃一个值就必须释放 该值拥有的任何其他值、堆存储和系统资源。 丢弃可能发生在多种情况下&#xff1a; 当变量超出作用域时&#xff1b;在表达式语句的末尾&#xff1b;当…...

网络安全基础以及概念

1. 安全领域的概念 1.1 网络产品 1. EDR:终端检测与响应(Endpoint Detection and Response),终端主要包括我们的笔记本、台式机、手机、服务器等,EDR是一种运行在终端上安全软件,主要负责监控网络流量、可疑进程、注册表活动等其他安全相关的事件与活动。当发现有威胁是自…...

windows和linux的抓包方式

1.实验准备&#xff1a; 一台windows主机&#xff0c;一台linux主机 wireshark使用&#xff1a; 打开wireshark&#xff0c;这些有波动的就代表可以有流量经过该网卡&#xff0c;选择一张有流量经过的网卡 可以看到很多的流量&#xff0c;然后可以使用过滤器来过滤想要的流量…...

【Uniapp-Vue3】v-if条件渲染及v-show的选择对比

如果我们想让元素根据响应式变量的值进行显示或隐藏可以使用v-if或v-show 一、v-show 另一种控制显示的方法就是使用v-show&#xff0c;使用方法和v-if一样&#xff0c;为true显示&#xff0c;为false则不显示。 二、v-if v-if除了可以像v-show一样单独使用外&#xff0c;还…...

宝塔面板使用 GoAccess Web 日志分析教程

宝塔面板是一个简单方便的服务器运维面板,但其网站统计功能是收费的。而 GoAccess 是一个用 C 编写的免费开源 Web日志分析器,本文将介绍如何在宝塔面板中开启 GoAccess Web 日志分析功能。 内容索引 下载安装 GoAccess在宝塔面板中添加日志切割的计划任务将 Web 日志输出到…...

Windows 安装 Docker 和 Docker Compose

&#x1f680; 作者主页&#xff1a; 有来技术 &#x1f525; 开源项目&#xff1a; youlai-mall ︱vue3-element-admin︱youlai-boot︱vue-uniapp-template &#x1f33a; 仓库主页&#xff1a; GitCode︱ Gitee ︱ Github &#x1f496; 欢迎点赞 &#x1f44d; 收藏 ⭐评论 …...

arcgis中用python脚本批量给多个要素类的相同字段赋值

1、python脚本 import arcpy# 设置工作空间路径 arcpy.env.workspace = r"D:\test.gdb"# 要素集名称 feature_dataset = "test"# 线要素类名称列表,初始化为空 line_feature_classes = []# 遍历要素集获取所有线要素类 for fc in arcpy.ListFeatureClass…...

目标客户营销(ABM)结合开源AI智能名片2+1链动模式S2B2C商城小程序的策略与实践

摘要&#xff1a;在数字化营销日益盛行的今天&#xff0c;目标客户营销&#xff08;Account Based Marketing, ABM&#xff09;作为一种高度定制化的营销策略&#xff0c;正逐步成为企业获取高质量客户、提升市场竞争力的重要手段。与此同时&#xff0c;开源AI智能名片21链动模…...

《异步编程之美》— 全栈修仙《Java 8 CompletableFuture 对比 ES6 Promise 以及Spring @Async》

哈喽&#xff0c;大家好&#xff01;在平常开发过程中会遇到许多意想不到的坑&#xff0c;本篇文章就记录在开发过程中遇到一些常见的问题&#xff0c;看了许多博主的异步编程&#xff0c;我只能说一言难尽。本文详细的讲解了异步编程之美&#xff0c;是不可多得的好文&#xf…...

wordpress 媒体库 链接/市场营销实务

系统消息和通知 阻塞队列 BlockingQueue时一个接口&#xff0c;又许多实现类 Kafka入门 高吞吐量&#xff1a;Kafka是硬盘顺序读取&#xff1a;硬盘顺序读取高于内存的随机读取。 高可靠性&#xff1a;分布式的集群 高扩展性&#xff1a;加集群很方便 Broker&#xff1a;K…...

无锡网站建设和/优化网站界面的工具

由于使用别人的Dll&#xff0c;导出的是一个实体类&#xff0c;在C#里封送很难&#xff0c;百度下&#xff0c;有个朋友回复一篇英文的&#xff0c;虽然不一定使用&#xff0c;但可以作为一个知识点&#xff0c;现把原文贴下&#xff1a; c#调用C写的dll导出类&#xff0c;包含…...

新公司网站建设流程/电子商务推广方式

依赖包安装 # 安装 myjs-common 包 npm install myjs-common1.0.0格式器表达式 YEAR_FORMAT&#xff1a; 年格式化-yyyyMONTH_FORMAT&#xff1a; 月格式化-yyyy-MMDATE_FORMAT&#xff1a; 日期格式化-yyyy-MM-ddHOUR_FORMAT&#xff1a; 时格式化-yyyy-MM-dd HHMINUTE_FORM…...

公司网站备案 问我借身份证 怎么拒绝/seo优化技术培训

1、安装N卡驱动 首先添加源 sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update然后检查可以安装的驱动版本号 nvidia-msi选择适合自己的驱动&#xff0c;这里需要注意不同版本的cuda需要的驱动版本号也不一样&#xff0c;参考表链接点这里 Ubuntu 18.04安…...

合肥网站建设制作公司/西安百度首页优化

内容&#xff1a;OMV在windows10下的文件共享--NAS基本条件Armbian的IP设置 以太网及WiFitransmission配置遇到的问题OMV在windows10下的文件共享--NAS基本条件看了好几个教程都有一些问题&#xff0c;目前找到可以的&#xff0c;参考链接哔哩哔哩-教你完成一台基于开源系统OMV…...

郑州做网站的公司哪些/百度seo搜索排名

一、jQuery 选择器jQuery 选择器简介- jQuery 选择器类似于 CSS 选择(定位元素&#xff0c;施加样式),能够实现定位元素&#xff0c;施加行为- 使用 jQuery 选择器能够将内容与行为分离- 学会使用选择器是学习 jQuery 的基础jQuery 选择器的优势- 简洁的写法:- $()工厂函数在很…...