java word转pdf 后通过 PdfReader 和 PdfStamper对pdf添加水印 通过poi等组件实现

2023-11-19

 所需jar包地址

        <!-- java 读取word文件里面的加颜色的字体  转pdf 使用  -->
        <dependency>
            <groupId> e-iceblue </groupId>
            <artifactId>spire.doc.free</artifactId>
            <version>3.9.0</version>
        </dependency>

  <!--poi 的相关组件 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>4.1.2</version>
        </dependency>

        <!-- 不添加此包会提示错误 :   org.openxmlformats.schemas.wordprocessingml.x2006.main.FontsDocument$Factory   -->
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
            <version>1.0.6</version>
        </dependency>

        <!-- 用于  word 转pdf  -->
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>xdocreport</artifactId>
            <version>2.0.2</version>
        </dependency>

        <!-- pdf 添加水印  对PDF文件的操作 -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.13.1</version>
        </dependency>
        <!-- PDF文件 字体 防止中文乱码  -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-asian</artifactId>
            <version>5.2.0</version>
        </dependency>

        <!--基于 poi实现word数据的替换 -->
        <dependency>
            <groupId>com.deepoove</groupId>
            <artifactId>poi-tl</artifactId>
            <version>1.9.1</version>
        </dependency>


  


        <!--
         如果下载jar失败,说明下载jar失败,需要以下的maven依赖
         [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
  --> 
        <repository>
            <id>com.e-iceblue</id>
               <url>http://repo.e-iceblue.cn/repository/maven-public/</url>
           </repository>
      </repositories>


        <!--        <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox</artifactId>
                    <version>2.0.25</version>
                </dependency>
               <dependency>
                    <groupId>fr.opensagres.xdocreport</groupId>
                    <artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
                    <version>1.0.6</version>
                </dependency>
               <dependency>
                    <groupId>fr.opensagres.xdocreport</groupId>
                    <artifactId>fr.opensagres.xdocreport.document</artifactId>
                    <version>2.0.2</version>
                </dependency>
                <dependency>
                    <groupId>fr.opensagres.xdocreport</groupId>
                    <artifactId>org.apache.poi.xwpf.converter.core</artifactId>
                    <version>1.0.6</version>
                </dependency>-->






    <!-- 打包使用,需要配置 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!-- 打包时会将本地jar一起打包 -->
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

执行代码main方法运行


import com.itextpdf.text.Element;
import com.itextpdf.text.pdf.*;
import fr.opensagres.poi.xwpf.converter.pdf.PdfOptions;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.io.*;

public class TestWordToPDF {

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        String docxPath =  "C:\\Users\\admin-xu\\Desktop\\11\\test.docx";
        String pdfPath =  "C:\\Users\\admin-xu\\Desktop\\11\\test2.pdf";
        File file = new File( docxPath);
        InputStream inputStream = new FileInputStream(file);
        ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
        XWPFDocument xwpfDocument = new XWPFDocument(inputStream);
        fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.getInstance().convert(xwpfDocument, pdfBaos, PdfOptions.create());
        inputStream.close();
        xwpfDocument.close();
        byte[] pdfArray = null;
        pdfArray = pdfBaos.toByteArray();
        pdfBaos.close();
        InputStream pdfInputStream = new ByteArrayInputStream( pdfArray ) ;
        FileOutputStream fileOutputStream = new FileOutputStream(pdfPath);
        addWaterMark(pdfInputStream , fileOutputStream);
        long end = System.currentTimeMillis();
        System.out.println("执行时间: " + ((end - start) / 1000) + "秒");
    }

    //给PDF文件添加水印
    public static void addWaterMark(InputStream pdfInputStream ,   FileOutputStream fileOutputStream) {
        try {
            // 原PDF文件
            PdfReader reader = new PdfReader(pdfInputStream);
            // 输出的PDF文件内容
            PdfStamper pdfStamper = new PdfStamper(reader,   fileOutputStream );
            // 字体 来源于 itext-asian JAR包
            BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", true);
            PdfGState pdfGState = new PdfGState();
            // 设置透明度
            pdfGState.setFillOpacity(0.2f);
            pdfGState.setStrokeOpacity(0.4f);
            int totalPage = reader.getNumberOfPages() + 1;
            for (int i = 1; i < totalPage; i++) {
                // 内容上层
//			PdfContentByte content = stamper.getOverContent(i);
                // 内容下层
                PdfContentByte pdfContentByte = pdfStamper.getUnderContent(i);
                pdfContentByte.beginText();
                // 字体添加透明度
                pdfContentByte.setGState(pdfGState);
                // 添加字体大小等
                pdfContentByte.setFontAndSize(baseFont, 20);
                // 添加范围
                pdfContentByte.setTextMatrix(70, 200);
                //  具体位置 内容   多少行  多少列  旋转多少度 共360度
                for (int a = 0; a < 3; a++) { // 一页几排
                    for (int j = 0; j < 3; j++) { // 一排几个
                        int x =  70 + 170 * j ;   // 横向  宽
                        int y =  170 + 200 *  a ;  // 纵向  高
                        pdfContentByte.showTextAligned(Element.ALIGN_BOTTOM, "机密文件"  , x, y, 45); // 45 是水印旋转的角度
                    }
                }
                pdfContentByte.endText();
            }
            // 关闭
            pdfStamper.close();
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

转换前的word

转换后的 pdf

 

执行结果和时间,项目中实际测试大概是5-6秒左右(和服务器性能相关)

实际代码使用,通过浏览器下载


   // 转换后 通过浏览器下载
    // word 替换数据后 下载   //     /replaceWordToPDF/exportWordPDF
    @GetMapping(value = "/exportWordPDF")
    public R<?> exportWordTest(@RequestParam Map<String , Object> mapCon, HttpServletResponse response) throws Exception {

        long a1 = System.currentTimeMillis();
        R resultBody = replaceWordDataService.replaceWord( mapCon );
        if(resultBody.getCode() == 0 ){
            byte[] array = null;
            ExportWordDTO data = (ExportWordDTO) resultBody.getData();
            XWPFTemplate template = data.getXwpfTemplate();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            template.writeAndClose( baos );//文档写入流
            array = baos.toByteArray();
            baos.close();
            template.close();
            // 替换后的word转流
            InputStream inputStream = new ByteArrayInputStream( array ) ;
            ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
            long  a2   =  System.currentTimeMillis();
            //  word 转pdf
            XWPFDocument xwpfDocument = new XWPFDocument(inputStream);
            fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.getInstance().convert(xwpfDocument, pdfBaos, PdfOptions.create());
            inputStream.close();
            xwpfDocument.close();

            byte[] pdfArray = null;
            pdfArray = pdfBaos.toByteArray();
            pdfBaos.close();
            // pdf 文件
            InputStream pdfInputStream = new ByteArrayInputStream( pdfArray ) ;
            response.setContentType("application/octet-stream");
            response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(  data.getOutFileName()+".pdf", "UTF-8"));
            OutputStream out = response.getOutputStream();
            long  a3   =  System.currentTimeMillis();

            // 添加水印
            // 原PDF文件
            PdfReader reader = new PdfReader(pdfInputStream);
            // 输出的PDF文件内容
            PdfStamper stamper = new PdfStamper(reader, out);
            // 字体 来源于 itext-asian JAR包
            BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", true);
            PdfGState gs = new PdfGState();
            // 设置透明度
            gs.setFillOpacity(0.2f);
            gs.setStrokeOpacity(0.4f);
            int totalPage = reader.getNumberOfPages() + 1;
            System.out.println( totalPage );
            for (int i = 1; i < totalPage; i++) {
                // 内容上层
//			PdfContentByte content = stamper.getOverContent(i);
                // 内容下层
                PdfContentByte content = stamper.getUnderContent(i);
                content.beginText();
                // 字体添加透明度
                content.setGState(gs);
                // 添加字体大小等
                content.setFontAndSize(baseFont, 20);
                // 添加范围
                content.setTextMatrix(70, 200);
                // 具体位置 内容 旋转多少度 共360度   复制艺术字并设置多行多列位置 ( 设置几排  )  //  多少列
                for (int a = 0; a < 3; a++) { // 一页几排
                    for (int j = 0; j < 3; j++) { // 一排几个
                        int x =  70 + 170 * j ;   // 横向  宽
                        int y =  170 + 200 *  a ;  // 纵向  高
                        content.showTextAligned(Element.ALIGN_BOTTOM, "户用光伏电站签约专用"  , x, y, 45);
                    }
                }
                content.endText();
            }
            // 关闭
            stamper.close();
            reader.close();
            pdfInputStream.close();
            out.close();
            long  a4   =  System.currentTimeMillis();

            System.out.println("word替换时间: " + ((a2 - a1) ) + "毫秒");
            System.out.println("word转pdf时间: " + ((a3 - a2) ) + "毫秒");
            System.out.println("添加水印时间: " + ((a4 - a3) ) + "毫秒");
            System.out.println("共计用时: " + ((a4 - a1) ) + "毫秒");

            PoitlIOUtils.closeQuietlyMulti(template,  out);

            return null;
        }else {
            return R.fail().msg(resultBody.getMsg());
        }
    }




获取转换后的pdf byte[]数组数组

注意这里有个坑 在关闭流的时候才往(输出流)写内容了,上面只是定义 并没有写到输入流 ByteArrayOutputStream,放到close上面是没数据的,只能放到 close 的下面,因为这一步才开始写数据



    // word 替换数据后 转换 pdf 添加水印后 获取字节数组 通过字节数组上传到文件服务器 
    @GetMapping(value = "/exportWordTestUrl")
    public R<?> exportWordTestUrl(@RequestParam Map<String , Object> mapCon  ) throws Exception {
        R resultBody = replaceWordDataService.replaceWord( mapCon );
        if(resultBody.getCode() == 0 ){
            byte[] array = null;
            ExportWordDTO data = (ExportWordDTO) resultBody.getData();
            XWPFTemplate template = data.getXwpfTemplate();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            template.writeAndClose( baos );//文档写入流
            array = baos.toByteArray();
            baos.close();
            template.close();
            // 替换后的word转流
            InputStream inputStream = new ByteArrayInputStream( array ) ;
            ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
            //  word 转pdf
            XWPFDocument xwpfDocument = new XWPFDocument(inputStream);
            fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.getInstance().convert(xwpfDocument, pdfBaos, PdfOptions.create());
            inputStream.close();
            xwpfDocument.close();

            byte[] pdfArray = null;
            pdfArray = pdfBaos.toByteArray();
            pdfBaos.close();
            // pdf 文件
            InputStream pdfInputStream = new ByteArrayInputStream( pdfArray ) ;
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            // 添加水印
            // 原PDF文件
            PdfReader reader = new PdfReader(pdfInputStream);
            // 输出的PDF文件内容
            PdfStamper stamper = new PdfStamper(reader,  out );
            // 字体 来源于 itext-asian JAR包
            BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", true);
            PdfGState gs = new PdfGState();
            // 设置透明度
            gs.setFillOpacity(0.2f);
            gs.setStrokeOpacity(0.4f);
            int totalPage = reader.getNumberOfPages() + 1;
            for (int i = 1; i < totalPage; i++) {
                // 内容上层
//			PdfContentByte content = stamper.getOverContent(i);
                // 内容下层
                PdfContentByte content = stamper.getUnderContent(i);
                content.beginText();
                // 字体添加透明度
                content.setGState(gs);
                // 添加字体大小等
                content.setFontAndSize(baseFont, 20);
                // 添加范围
                content.setTextMatrix(70, 200);
                // 具体位置 内容 旋转多少度 共360度   复制艺术字并设置多行多列位置 ( 设置几排  )  //  多少列
                for (int a = 0; a < 3; a++) { // 一页几排
                    for (int j = 0; j < 3; j++) { // 一排几个
                        int x =  70 + 170 * j ;   // 横向  宽
                        int y =  170 + 200 *  a ;  // 纵向  高
                        content.showTextAligned(Element.ALIGN_BOTTOM, "户用光伏电站签约专用"  , x, y, 45);
                    }
                }
                content.endText();
            }

            pdfInputStream.close();
            // 注意这里有个坑  在关闭流的时候才往(输出流)写内容了,上面只是定义 并没有写到输入流   ByteArrayOutputStream,放到close上面是没数据的,只能放到 close 的下面,
            // 因为这一步才开始写数据
            stamper.close();
            reader.close();
            byte[] bytes =  out.toByteArray();
            out.close();
            PoitlIOUtils.closeQuietlyMulti(template,  out);
            R<ResultFileModel> upload = remoteFileService.upload(bytes, 1, applicationName,  "户光伏电站签约专用.pdf");
            if (null !=  upload && upload.getCode() == 0){
                // 将url 存入数据库
                ResultFileModel fileModel = upload.getData();
                String path = fileModel.getAddress() +    fileModel.getPath();
                replaceWordDataService.updatePdfUrl( path ,    mapCon.get("-data_id-") .toString()  );
                return R.ok().data("添加成功");
            }else {
                return R.fail().msg( "文件上传失败!" );
            }
        }
        return R.fail().msg(resultBody.getMsg());
    }

另外一种方法

java word转换pdf(先自定义添加水印 后转换pdf)_My--Style的博客-CSDN博客

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

java word转pdf 后通过 PdfReader 和 PdfStamper对pdf添加水印 通过poi等组件实现 的相关文章

  • Maven:无法在 OS X 上找到 java.lang 问题

    当我尝试时遇到以下问题mvn clean install显然它无法找到运行时 jar 但我需要做什么 错误日志 ERROR COMPILATION ERROR INFO ERROR Failure executing javac but c
  • 如何制作具有两个索引的 Map?

    我在java中有一张这样的地图 Map
  • 如何为Spring Boot中的所有控制器指定前缀?

    我有控制器映射到 user and order RestController RequestMapping users public class UserController RestController RequestMapping or
  • JCombobox 字符串项(可见)和整数键(固有)

    我有一个数据库模式 它将作为 JTable 列显示在 JCombobox 中以选择名称 但我希望将 ID 字段插入 作为外键 到另一个表中 通常 在下拉列表中选择一个项目 将所选项目带到组合框的显示区域 我想要做的是 当选择组合框中的任何项
  • 在名称为 [重复] 的 DispatcherServlet 中未找到带有 URI 的 HTTP 请求的映射...

    这个问题在这里已经有答案了 我已经检查了 stackoverflow 上几乎所有相关文章 但我就是无法解决我的问题 这是代码 网络 xml
  • Java Sound可以用来控制系统音量吗?

    Java 声音优惠FloatControl各种声音线路功能的实例 以及MASTER GAIN http docs oracle com javase 7 docs api javax sound sampled FloatControl T
  • 在所有方法调用上允许类型见证有什么意义?

    假设我们有两种方法 如下所示 public static
  • 如何在不打开浏览器的情况下查看 Android 应用程序中的网页?

    嘿 我正在开发一个 Android 应用程序 我想连接到该应用程序内的网络 不过 我在某种程度上尝试过 WebView 但它在我的目录中显示的文件很好 但当连接到 google com 时 它显示错误 然后我添加了这个文件
  • 码头无故停止

    我需要经验丰富的码头用户的建议 我在负载均衡器 亚马逊云 后面维护着 2 台 Linux 机器 使用 Jetty 9 0 3 有时我的 Jetty 容器会被 Thread 2 无故关闭 同时地 显示以下日志并且容器无故停止 没有错误 没有例
  • JList 类型不采用参数类型

    当我尝试编译一些代码时 我不断收到这些错误 CCC java 21 type javax swing JList does not take parameters JList
  • JS 中的 .Jar 文件

    有谁知道如何在 JS 中访问 jar 文件 我已经用 Java 创建了类并作为 jar 文件导入 我想从 JS 文件访问该类 大家好 我感谢你们所有人 我尝试在 Firefox XUL 中使用 JS 列出文件夹中的文件 但我做不到 然后我决
  • 在 Struts 2 中使用单个文件标签上传多个文件

    我想使用单个 Struts 2 文件标签上传多个文件 就像在 Gmail 中一样 我们使用 CTRL 键来选择多个文件来附加多个文件 我知道如何上传多个文件 但我想使用单个文件标签 我在一个小画廊应用程序中上传多个文件 如果您的操作已设置为
  • 如何使用JSqlParser向sql添加where条件?

    我想用JSqlParser向sql添加where条件 例如 Before select from test table where a 1 group by c After select from test table where a 1
  • 从 Brixton.RC1 开始的 ZuulProxy 未传递授权标头

    从 Spring Cloud 切换时Brixton M5 to Brixton RC1我的 ZuulProxy 不再通过Authorization标头下游到我的代理服务 我的设置中有各种各样的角色 但大多数都相当简单 Authorizati
  • 如何组织课程、课程包[关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 您如何决定包名称应该是什么以及什么类应该放入哪个包中 我正在开发一个项目 在该项目中 我不断添加 删除类 并且不确定我是否需要一个新包 或者应该将其添
  • 正确的单元测试技术

    在使用 TDD 时 我发现自己需要测试一个包含查找值的常量 最终 哈希图 请查看更新中出现这种情况的原因 见下文 private static final Map
  • 启动 Firefox 并等待其关闭

    Question 我想启动 Firefox 网络浏览器作为访问特定网站的过程 然后等到它关闭 一种特殊情况是浏览器可能已经打开并正在运行 因为用户可能已经访问过某个网站 在这种情况下 浏览器可能会在现有窗口中打开一个新选项卡 并且新启动的进
  • 尝试接收 UDP 多播时出现空指针异常

    在尝试了几次让简单的 UDP 多播接收器工作后 我感到很困惑 在我自己的代码无法按预期工作后 我尝试了 vertx 文档中发布的确切示例 DatagramSocket socket vertx createDatagramSocket ne
  • 如果垃圾收集器没有删除未引用的对象,它们还能运行吗?

    如果一个对象正在等待垃圾收集 但包含一个在该对象的最后一个引用更改时正在运行的线程 那么该线程是否仍会运行并且代码是否仍会执行 那么您是否可能有一堆应该删除的幽灵对象 但它们对您的代码产生了影响 你如何防止这种情况发生 有没有办法让对象知道
  • java 更新进度条

    我有一个 JFrame 和以下组件 JButton jButton1 Progress Bar ProgressBar 及其公共静态 JLabel 状态及其公共静态 单击按钮时会执行不同的语句 我想在每个语句后更新我的进度条 这是我的代码

随机推荐

  • mac os mysql忘记root密码_mac上mysql报错以及root密码忘记解决办法

    1 对于前者ERROR 2002 HY000 Can t connect to local MySQL server through socket tmp mysql sock 2 这个错误 一般是mysql服务没开 命令行下执行sudo
  • java8的时期和时间

    文章目录 旧版日期时间的问题 新版日期时间介绍 Java util date java sql date SimpleDateFormatter calendar java8日期 DateTimeFormatter 计算 java8之前 j
  • Python学习 第五章 图形界面设计

    第五章 图形界面设计 1 常用的 Python GUI 库 1 1 Tkinter 1 2 wxPython 1 3 创建GUI程序 2 创建Windows窗口 3 几何布局管理器 3 1 pack 包装 3 2 grid 网格 3 3 p
  • leetcode移动零c++

    给定一个数组 nums 编写一个函数将所有 0 移动到数组的末尾 同时保持非零元素的相对顺序 示例 输入 0 1 0 3 12 输出 1 3 12 0 0 说明 必须在原数组上操作 不能拷贝额外的数组 尽量减少操作次数 整体思路 题目中都出
  • 软件项目经理的基本职责

    软件项目经理的基本职责 1 制定项目计划 并根据各种变化修改项目计划2 实施 项目的管理 开发 质量保证过程 确保客户的成本 进度 绩效和质量目标 3 制定有效的项目决策过程4 确保在项目生命周期中遵循是实施公司的管理和质量政策5 选择一个
  • VC++ CComboBox自绘(选择下拉列表框)

    效果图 头文件定义 CSWCheckComboBox h pragma once class CSWCheckComboBox public CComboBox DECLARE DYNAMIC CSWCheckComboBox 成员私有结构
  • gdal解析tif

    bool HandleTif ReadTif tif文件读取 std string name D XX xx tif const char charName name c str 注册 GDALAllRegister 以防中文名不能正常读取
  • Docker本地镜像推送到私有库

    Docker Registry是官方提供的工具 可以用于构建私有镜像仓库 1 下载镜像Docker Registry docker pull registy 2 运行私有库Registry 相当于本地有个私有Docker hub docke
  • 计算机基础——Excel 2010

    天软备考交流群 365218976 1 Excel 2010的基本操作 1 1 Excel的窗口界面 1 2 工作簿与工作表 1 3 单元格区域的管理 1 4 工作表的管理 1 5 输入和编辑数据 1 6 行 列和单元格的管理 1 7 批注
  • java代码引用jar包中文件的方法

    jar是一个单独的文件 里面的文件称之为资源 有两种方法获取 里面的资源文件 一般将资源文件放到resources文件夹中 1 推荐 静态和非静态方法中都能用 ClassName class getClassLoader getResour
  • 刷脸支付服务商抓住机会迎头赶上

    科技改变未来并不是一句口号 就拿买东西来讲 以前人们都是一手交钱一手交货 拿到大额的纸币 还要验真假 而现在移动支付成为主要付款方式 只要一部手机 扫一扫就能付款 一开始也有很多人不习惯手机支付 因为觉得没有现金实在 整天就是一堆数字转来转
  • 前端手写(正则、字符串、函数)

    1 实现千位分隔符 保留三位小数 parseToMoney 1234 56 return 1 234 56 parseToMoney 123456789 return 123 456 789 parseToMoney 1087654 321
  • ajax 传回underfined,$.jquery ajax返回的数据(json)显示为’undefined’

    这里我有一个简单的 PHP脚本 它以json格式显示数据库中的一些值 source GET source query MysqL query SELECT FROM images WHERE big thumb source results
  • Anaconda安装教程及numpy环境配置

    一 下载Anaconda 下载地址 https www anaconda com 二 安装Anaconda 1 进入官网后 看不懂英文可以先将网页翻译成中文 然后点击产品 gt 个人版 如图进入下载页面 2 可以直接点击下载 也可以滚动到页
  • 并发编程----4.java并发包中线程池的原理研究

    并发编程 4 java并发包中线程池的原理研究 java并发包中线程池ThreadPoolExecutor的原理研究 线程池的优点 线程的复用 减少线程创建和销毁带来的消耗 提供了一种资源限制和线程管理的手段 比如限制线程的个数和动态新增线
  • 数据库常用工具

    定期对你的MYSQL数据库进行一个体检 是保证数据库安全运行的重要手段 因为 好的工具是使你的工作效率倍增 常用工具 1 mysql 该mysql不是指mysql服务 而是指mysql的客户端工具 语法 mysql options data
  • 官方系统镜像烧写(windows下使用OTG)

    目录 OTG系统烧写 为什么能通过VBS将系统烧写进去呢 OTG系统烧写 选择对应的烧写工具 USB OTG线连接好 双击即可进行烧写 注意 当然也可以烧写到SD卡里面 前面我们烧写裸机代码都是选择从SD卡启动 Mfgtool这个工具先向板
  • unity官方demo学习之Stealth(二)警报灯设定

    为light alarm directional添加脚本DoneAlarmLight AlarmLight cs using UnityEngine using System Collections public class DoneAla
  • 设计模式-2--工厂模式(Factory Pattern)

    一 什么是工厂模式 工厂模式 Factory Pattern 是一种创建型设计模式 它提供了一种创建对象的接口 但是将对象的实例化过程推迟到子类中 工厂模式允许通过调用一个共同的接口方法来创建不同类型的对象 而无需暴露对象的实例化逻辑 工厂
  • java word转pdf 后通过 PdfReader 和 PdfStamper对pdf添加水印 通过poi等组件实现

    所需jar包地址