java: itext8.05 create pdf
只能调用windows 已安装的字体,这样可以在系统中先预装字体,5.0 可以调用自配文件夹的字体文件。CSharp donetItext8.0 可以调用。
/*** encoding: utf-8* 版权所有 2024 ©涂聚文有限公司 言語成了邀功盡責的功臣,還需要行爲每日來值班嗎* 许可信息查看: https://github.com/itext/itext-publications-examples-java/blob/develop/src/main/java/com/itextpdf/samples/sandbox/fonts/FreeSansBold.java* 描述:https://mvnrepository.com/artifact/com.itextpdf/kernel* # Author : geovindu,Geovin Du 涂聚文.* # IDE : IntelliJ IDEA 2023.1 Java 17* # Datetime : 2024 - 2024/11/20 - 20:13* # User : geovindu* # Product : IntelliJ IDEA* # Project : EssentialAlgorithms itext8.05* # File : SimpleItext.java* # explain : 学习 类**/package BLL;//import java.awt.*;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.itextpdf.io.font.PdfEncodings;
import com.itextpdf.io.font.TrueTypeFont;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.colors.*;
import com.itextpdf.kernel.colors.gradients.*;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.font.*;
import com.itextpdf.kernel.pdf.*;
import com.itextpdf.kernel.pdf.canvas.draw.*;
import com.itextpdf.io.image.ImageData;
import com.itextpdf.io.image.ImageDataFactory;
import com.itextpdf.io.font.FontProgramFactory;
import com.itextpdf.layout.element.*;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.borders.Border;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Image;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.element.Table;
import com.itextpdf.layout.properties.TextAlignment;
import com.itextpdf.layout.properties.UnitValue;
import com.itextpdf.layout.properties.VerticalAlignment;
import com.itextpdf.layout.properties.HorizontalAlignment;
import com.itextpdf.layout.element.Text;
import com.itextpdf.layout.borders.*;
import com.itextpdf.layout.borders.SolidBorder;
import com.itextpdf.io.util.StreamUtil;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;import java.io.File;
import java.util.HashSet;
import java.util.Set;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.nio.file.Paths;import Model.Orders;public class SimpleItext {private static String USER_PASSWORD = "geovindu";private static String OWNER_PASSWORD = "geovindu";public static final String FONTDIR = "font/";public void test(){try {String fontFile2 = "font/MHeiHK-Light.TTF";String path = "C:/WINDOWS/Fonts/simhei.ttf";//windows里的字体资源路径String getfont="";// Creating a PdfWriter objectString dest = "coloredBorders.pdf";//PdfFont pfont=null;PdfWriter writer = new PdfWriter(dest);// Creating a PdfDocument objectPdfDocument pdfDoc = new PdfDocument(writer);// Creating a Document objectDocument doc = new Document(pdfDoc);PdfFontFactory.registerDirectory(FONTDIR);byte[] bytes;FileInputStream myflie = new FileInputStream(fontFile2);//var is = getClass().getResourceAsStream(fontFile2);bytes = StreamUtil.inputStreamToArray(myflie);//byte[] tem = new byte[myflie.available()];//创建一个长度为myflie长的竹筒//myflie.read(tem);//var pfont = FontProgramFactory.createFont(bytes);//PdfFont pfont = PdfFontFactory.createFont(bytes, PdfEncodings.UTF8);/*Set<String> fonts = new HashSet<String>(FontProgramFactory.getRegisteredFonts());for (String fontname : fonts) {System.out.print(fontname);getfont=fontname;pfont = PdfFontFactory.createRegisteredFont(getfont, PdfEncodings.IDENTITY_H);doc.add(new Paragraph(String.format("Postscript name for %s: %s", getfont,pfont.getFontProgram().getFontNames().getFontName())));}*///PdfFont f2 = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H");PdfFont pfont = PdfFontFactory.createFont(path, PdfEncodings.IDENTITY_H);//PdfFontFactory.EmbeddingStrategy.FORCE_EMBEDDED// Creating a tablefloat[] pointColumnWidths = {200F, 200F};Table table = new Table(pointColumnWidths);// Adding row 1 to the tableCell c1 = new Cell();// Adding the contents of the cellc1.add(new Paragraph("Name").setFont(pfont));// Setting the back ground color of the cellc1.setBackgroundColor(ColorConstants.DARK_GRAY);// Instantiating the Border classBorder b1 = new DashedBorder(ColorConstants.RED, 3);// Setting the border of the cellc1.setBorder(b1);// Setting the text alignmentc1.setTextAlignment(TextAlignment.CENTER);// Adding the cell to the tabletable.addCell(c1);Cell c2 = new Cell();c2.add(new Paragraph("涂聚文").setFont(pfont));c1.setBorder(new SolidBorder(ColorConstants.RED, 3));c2.setTextAlignment(TextAlignment.CENTER);table.addCell(c2);// Adding row 2 to the tableCell c3 = new Cell();c3.add(new Paragraph("Id").setFont(pfont));c3.setBorder(new DottedBorder(ColorConstants.DARK_GRAY, 3));c3.setTextAlignment(TextAlignment.CENTER);table.addCell(c3);Cell c4 = new Cell();c4.add(new Paragraph("001").setFont(pfont));c4.setBorder(new DoubleBorder(ColorConstants.DARK_GRAY, 3));c4.setTextAlignment(TextAlignment.CENTER);table.addCell(c4);// Adding row 3 to the tableCell c5 = new Cell();c5.add(new Paragraph("Designation").setFont(pfont));c5.setBorder(new RoundDotsBorder(ColorConstants.RED, 3));c5.setTextAlignment(TextAlignment.CENTER);table.addCell(c5);Cell c6 = new Cell();c6.add(new Paragraph("Programmer").setFont(pfont));c6.setBorder(new RoundDotsBorder(ColorConstants.RED, 3));c6.setTextAlignment(TextAlignment.CENTER);table.addCell(c6);// Adding Table to documentdoc.add(table);// Closing the documentdoc.close();System.out.println("Borders added successfully..");}catch(IOException oex){oex.printStackTrace();}catch (Exception ex){ex.printStackTrace();}}public void Createpdf(){try{String dem="itextExample.pdf";PdfWriter writer =new PdfWriter(dem);//设置打开文档必码// writer.setEncryption(USER_PASSWORD.getBytes(),//OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING,//PdfWriter.ENCRYPTION_AES_128);String fontFile2 = "font\\MHeiHK-Light.TTF"; // 这个报错: Type of font is not recognizedString path = "C:/WINDOWS/Fonts/simhei.ttf";//windows里的字体资源路径//PdfFont f2 = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H");PdfFont pfont = PdfFontFactory.createFont(path, PdfEncodings.IDENTITY_H);//PdfFontFactory.EmbeddingStrategy.FORCE_EMBEDDED//PdfFont pfont = PdfFontFactory.createRegisteredFont(path, PdfEncodings.IDENTITY_H);PdfDocument pdfDoc = new PdfDocument(writer);Document document = new Document(pdfDoc);//document.setFont(pfont);//document.open();document.add(new Paragraph("Some content here").setFont(pfont).setFontColor(ColorConstants.RED));//Set attributes here//document.("Geovin Du 涂聚文");// document.addCreationDate();//document.addCreator("dusystem.com");//document.addTitle("Set Attribute Example");//document.addSubject("An example to show how attributes can be added to pdf files.");Table table = new Table(3,true); // 3 columns.//table.setHeight(100); //Width 100%//table.setHeight(10f); //Space before table//table.setSpacingAfter(10f); //Space after table//Set Column widths//float[] columnWidths = {1f, 1f, 1f};//table.setHeight(columnWidths);Cell cell1 = new Cell().add(new Paragraph("深圳市").setFont(pfont));cell1.setBorder(new SolidBorder(ColorConstants.BLACK, 1));cell1.setPaddingLeft(10);cell1.setHorizontalAlignment(HorizontalAlignment.CENTER);cell1.setVerticalAlignment(VerticalAlignment.MIDDLE);Cell cell2 = new Cell().add(new Paragraph("南山區").setFont(pfont).setFontColor(ColorConstants.GREEN));cell2.setBorder(new SolidBorder(ColorConstants.BLACK, 1));cell2.setPaddingLeft(10);cell2.setHorizontalAlignment(HorizontalAlignment.LEFT);cell2.setVerticalAlignment(VerticalAlignment.MIDDLE);//.setVerticalAlignment(VerticalAlignment.MIDDLE)Cell cell3 = new Cell().add(new Paragraph("科技園").setFont(pfont));cell3.setBackgroundColor(ColorConstants.RED);cell3.setPaddingLeft(10);cell3.setHorizontalAlignment(HorizontalAlignment.CENTER);cell3.setVerticalAlignment(VerticalAlignment.MIDDLE);table.addCell(cell1);table.addCell(cell2);table.addCell(cell3);// table.complete();document.add(table);List<Orders> orders = new ArrayList<>();Orders order = new Orders();order.setProductId(1); ;order.setProduct("中國電器");order.setQty(50);order.setPrice(52.0);orders.add(order);order = new Orders();order.setProductId(2);order.setProduct ("日本電器");order.setQty(150);order.setPrice(252.0);orders.add(order);//2Table tableData = new Table(5, true);tableData.setBorder(new SolidBorder(ColorConstants.BLACK, 1));tableData.setFont(pfont);Cell headerProductId = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("ID"));Cell headerProduct = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("產品名稱"));Cell headerProductPrice = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("價格"));Cell headerProductQty = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("數量"));Cell headerTotal = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("合計"));tableData.addCell(headerProductId);tableData.addCell(headerProduct);tableData.addCell(headerProductPrice);tableData.addCell(headerProductQty);tableData.addCell(headerTotal);double grandTotalVal = 0;for(Orders c:orders){Cell productid = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getProductId())));Cell product = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(c.getProduct()));Cell price = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getPrice())));Cell qty = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getQty())));var value = c.getPrice() * c.getQty();Cell total = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(value)));grandTotalVal += value;tableData.addCell(productid);tableData.addCell(product);tableData.addCell(price);tableData.addCell(qty);tableData.addCell(total);}Cell grandTotalHeader = new Cell(1, 4).setTextAlignment(TextAlignment.RIGHT).add(new Paragraph("合計: ")).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));Cell grandTotal = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(" " + String.valueOf(grandTotalVal))).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));grandTotal.setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));tableData.addCell(grandTotalHeader);tableData.addCell(grandTotal);//tableData.complete();document.add(tableData);Table tablebottom = new Table(4,true);//tablebottom.setBorder(new SolidBorder(ColorConstants.BLACK, 3));tablebottom.setHorizontalAlignment(HorizontalAlignment.CENTER);tablebottom.addCell(new Cell().add(new Paragraph("產品ID").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("名稱").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("書量").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("價格").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));//table.setHeaderRows(1);//Cell[] cells = table.getCell(2,3);//for (int j=0;j<cells.length;j++){//cells[j].setBackgroundColor(ColorConstants.BLACK);//}for (Orders s:orders){Cell cel1= new Cell().add(new Paragraph(String.valueOf(s.getProductId()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel1.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel1);Cell cel2=new Cell().add(new Paragraph(s.getProduct()).setFont(pfont)).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel2.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel2);Cell cel3=new Cell().add(new Paragraph(String.valueOf(s.getQty()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel3.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel3);Cell cel4=new Cell().add(new Paragraph(String.valueOf(s.getPrice()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel4.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel4);}Cell cel1= new Cell().add(new Paragraph("3").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)));cel1.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel1);Cell cel2=new Cell().add(new Paragraph("涂聚文").setFont(pfont).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel2.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel2);Cell cel3=new Cell().add(new Paragraph("333").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel3.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel3);Cell cel4=new Cell().add(new Paragraph("3333").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel4.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel4);document.add(tablebottom);ImageData imageData = ImageDataFactory.create("geovindu.jpg");Image image1 = new Image(imageData);//Fixed Positioning//image1.setAbsolutePosition(205f, 150f);//Scale to new height and new width of imageimage1.scaleAbsolute(100, 100);//Add to documentdocument.add(image1);document.close();writer.close();} catch (Exception e){e.printStackTrace();}}}
调用:
//SimpleItext itextpdf=new SimpleItext();//itextpdf.test();itextpdf.Createpdf();
相关文章:

java: itext8.05 create pdf
只能调用windows 已安装的字体,这样可以在系统中先预装字体,5.0 可以调用自配文件夹的字体文件。CSharp donetItext8.0 可以调用。 /*** encoding: utf-8* 版权所有 2024 ©涂聚文有限公司 言語成了邀功盡責的功臣,還需要行爲每日來值班…...
如何用通义灵码快速绘制流程图?
使用通义灵码快速绘制流程图?新功能体验 不想读前人“骨灰级”代码,不想当“牛马”程序员,想像看图片一样快速读复杂代码和架构? 通义灵码已经支持代码逻辑可视化,可以把你的每段代码画成流程图。像个脑图工具一样帮你…...

vue 预览pdf 【@sunsetglow/vue-pdf-viewer】开箱即用,无需开发
sunsetglow/vue-pdf-viewer 开箱即用的pdf插件sunsetglow/vue-pdf-viewer, vue3 版本 无需多余开发,操作简单,支持大文件 pdf 滚动加载,缩放,左侧导航,下载,页码,打印,文本复制&…...

Java NIO 核心知识总结
在学习 NIO 之前,需要先了解一下计算机 I/O 模型的基础理论知识。还不了解的话,可以参考我写的这篇文章:Java IO 模型详解。 一、NIO 简介 在传统的 Java I/O 模型(BIO)中,I/O 操作是以阻塞的方式进行的。…...

疑难Tips:NextCloud域名访问登录时卡住,显示违反内容安全策略
[ 知识是人生的灯塔,只有不断学习,才能照亮前行的道路 ] 1使用域名访问Nextcloud用户登录时卡住,显示违反内容安全策略 我使用官方Docker镜像来部署NextCloud 28.0.5,并通过Openresty反向代理Nextcloud,但是在安装后无法稳定工作,每次登录后,页面会卡死在登录界面,无法…...

C 语言学习-06【指针】
1、目标单元与简介存取 直接访问和间接访问 #include <stdio.h>int main(void) {int a 3, *p;p &a;printf("a %d, *p %d\n", a, *p);*p 10;printf("a %d, *p %d\n", a, *p);printf("Enter a: ");scanf("%d", &a)…...

如何快速将Excel数据导入到SQL Server数据库
工作中,我们经常需要将Excel数据导入到数据库,但是对于数据库小白来说,这可能并非易事;对于数据库专家来说,这又可能非常繁琐。 这篇文章将介绍如何帮助您快速的将Excel数据导入到sql server数据库。 准备工作 这里&…...

【人工智能】Python在机器学习与人工智能中的应用
Python因其简洁易用、丰富的库支持以及强大的社区,被广泛应用于机器学习与人工智能(AI)领域。本教程通过实用的代码示例和讲解,带你从零开始掌握Python在机器学习与人工智能中的基本用法。 1. 机器学习与AI的Python生态系统 Pyth…...

使用八爪鱼爬虫抓取汽车网站数据,分析舆情数据
我是做汽车行业的,可以用八爪鱼爬虫抓取汽车之家和微博上的汽车文章内容,分析各种电动汽车口碑数据。 之前,我写过很多Python网络爬虫的案例,使用requests、selenium等技术采集数据,这次尝试去采集小米SU7在微博、汽车…...
什么是事务?事务有哪些特性?
在数据库管理中,事务是一个核心概念,它确保了数据操作的完整性和一致性。本文将探讨事务的定义及其四大特性。 一、事务的定义 事务是数据库操作的最小工作单元,是作为单个逻辑工作单元执行的一系列操作。这些操作作为一个整体一起向系统提…...
玩转合宙Luat教程 基础篇④——程序基础(库、线程、定时器和订阅/发布)
文章目录 一、前言二、库三、线程四、定时器五、订阅/发布5.1 回调函数5.2 堵塞等待一、前言 教程目录大纲请查阅:玩转合宙Luat教程——导读 写一写Lua程序基础的东西。 包括如何调用库,如何创建线程、如何创建定时器,如何使用订阅/发布事件。 二、库 程序从main.lua开始通…...

24.<Spring博客系统①(数据库+公共代码+持久层+显示博客列表+博客详情)>
项目整体预览 登录页面 主页 查看全文 编辑 写博客 PS:Service.impl(现在流行写法) 推荐写法。后续完成项目。会尝试这样写。 接口可以有多个实现。每个实现都可以不同。 这也算一种设计模式。叫做(策略模式)。 我们…...

webp 网页如何录屏?
工作中正好研究到了一点:记录下这里: 先看下效果: 具体实现代码:  <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport&qu…...

丹摩征文活动|实现Llama3.1大模型的本地部署
文章目录 1.前言2.丹摩的配置3.Llama3.1的本地配置4. 最终界面 丹摩 1.前言 Llama3.1是Meta 公司发布的最新开源大型语言模型,相较于之前的版本,它在规模和功能上实现了显著提升,尤其是最大的 4050亿参数版本,成为开源社区中非常…...
Spring Boot 2 和 Spring Boot 3 中使用 Spring Security 的区别
文章目录 Spring Boot 2 和 Spring Boot 3 中使用 Spring Security 的区别1. Jakarta EE 迁移2. Spring Security 配置方式的变化3. PasswordEncoder 加密方式的变化4. permitAll() 和 authenticated() 的变化5. 更强的默认安全设置6. Java 17 支持与语法提升7. PreAuthorize、…...

【数据结构与算法】 LeetCode:回溯
文章目录 回溯算法组合组合总和(Hot 100)组合总和 II电话号码的字母组合(Hot 100)括号生成(Hot 100)分割回文串(Hot 100)复原IP地址子集(Hot 100)全排列&…...
SpringBoot线程池的使用
SpringBoot线程池的使用 在现代Web应用开发中,特别是在使用Spring Boot框架时,合理使用线程池可以显著提高应用的性能和响应速度。线程池不仅能够减少线程创建和销毁的开销,还能有效地控制并发任务的数量,避免因线程过多而导致的…...

Neural Magic 发布 LLM Compressor:提升大模型推理效率的新工具
每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗?订阅我们的简报,深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同,从行业内部的深度分析和实用指南中受益。不要错过这个机会,成为AI领…...
HttpServletRequest req和前端的关系,req.getParameter详细解释,req.getParameter和前端的关系
HttpServletRequest 对象在后端和前端之间起到了桥梁的作用,它包含了来自客户端的所有请求信息。通过 HttpServletRequest 对象,后端可以获取前端发送的请求参数、请求头、请求方法等信息,并根据这些信息进行相应的处理。以下是对 HttpServle…...
React-useEffect的使用
useEffect react提供的一个常用hook,用于在函数组件中执行副作用操作,比如数据获取、订阅或手动更改DOM。 基本用法: 接受2个参数: 一个包含命令式代码的函数(副作用函数)。一个依赖项数组,用…...
条件运算符
C中的三目运算符(也称条件运算符,英文:ternary operator)是一种简洁的条件选择语句,语法如下: 条件表达式 ? 表达式1 : 表达式2• 如果“条件表达式”为true,则整个表达式的结果为“表达式1”…...
Spring Boot面试题精选汇总
🤟致敬读者 🟩感谢阅读🟦笑口常开🟪生日快乐⬛早点睡觉 📘博主相关 🟧博主信息🟨博客首页🟫专栏推荐🟥活动信息 文章目录 Spring Boot面试题精选汇总⚙️ **一、核心概…...
2023赣州旅游投资集团
单选题 1.“不登高山,不知天之高也;不临深溪,不知地之厚也。”这句话说明_____。 A、人的意识具有创造性 B、人的认识是独立于实践之外的 C、实践在认识过程中具有决定作用 D、人的一切知识都是从直接经验中获得的 参考答案: C 本题解…...

ABAP设计模式之---“简单设计原则(Simple Design)”
“Simple Design”(简单设计)是软件开发中的一个重要理念,倡导以最简单的方式实现软件功能,以确保代码清晰易懂、易维护,并在项目需求变化时能够快速适应。 其核心目标是避免复杂和过度设计,遵循“让事情保…...
管理学院权限管理系统开发总结
文章目录 🎓 管理学院权限管理系统开发总结 - 现代化Web应用实践之路📝 项目概述🏗️ 技术架构设计后端技术栈前端技术栈 💡 核心功能特性1. 用户管理模块2. 权限管理系统3. 统计报表功能4. 用户体验优化 🗄️ 数据库设…...

Golang——9、反射和文件操作
反射和文件操作 1、反射1.1、reflect.TypeOf()获取任意值的类型对象1.2、reflect.ValueOf()1.3、结构体反射 2、文件操作2.1、os.Open()打开文件2.2、方式一:使用Read()读取文件2.3、方式二:bufio读取文件2.4、方式三:os.ReadFile读取2.5、写…...

给网站添加live2d看板娘
给网站添加live2d看板娘 参考文献: stevenjoezhang/live2d-widget: 把萌萌哒的看板娘抱回家 (ノ≧∇≦)ノ | Live2D widget for web platformEikanya/Live2d-model: Live2d model collectionzenghongtu/live2d-model-assets 前言 网站环境如下,文章也主…...
LangFlow技术架构分析
🔧 LangFlow 的可视化技术栈 前端节点编辑器 底层框架:基于 (一个现代化的 React 节点绘图库) 功能: 拖拽式构建 LangGraph 状态机 实时连线定义节点依赖关系 可视化调试循环和分支逻辑 与 LangGraph 的深…...

论文阅读:LLM4Drive: A Survey of Large Language Models for Autonomous Driving
地址:LLM4Drive: A Survey of Large Language Models for Autonomous Driving 摘要翻译 自动驾驶技术作为推动交通和城市出行变革的催化剂,正从基于规则的系统向数据驱动策略转变。传统的模块化系统受限于级联模块间的累积误差和缺乏灵活性的预设规则。…...
如何配置一个sql server使得其它用户可以通过excel odbc获取数据
要让其他用户通过 Excel 使用 ODBC 连接到 SQL Server 获取数据,你需要完成以下配置步骤: ✅ 一、在 SQL Server 端配置(服务器设置) 1. 启用 TCP/IP 协议 打开 “SQL Server 配置管理器”。导航到:SQL Server 网络配…...