# htmltopdf **Repository Path**: oeoe/htmltopdf ## Basic Information - **Project Name**: htmltopdf - **Description**: 将html页面转换为pdf,支持windows64和linux64 - **Primary Language**: Java - **License**: MPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 1 - **Created**: 2019-10-22 - **Last Updated**: 2023-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # htmltopdf #### 介绍 将html页面转换为pdf,对标签不严格,图片url如果是本地地址,将图片转换为base64编码并替换url,仅支持windows64和linux64 #### 软件架构 maven作为构建工具。 #### 安装教程 1. 可以作为jar包引入 2. 或下载源码构建jar包 3. 或下载源码复制到项目中 #### 使用说明 ```$xslt String html =" How are you?"; String pdfName="demo"; FileItem sx = HtmlToPDFUtils.build().convertPDFFromText(html, pdfName); OutputStream outputStream = sx.getOutputStream();//得到pdf的输出流 byte[] bytes = sx.get();//得到pdf的byte数组数据 ... ``` 1. convertPDFFromText(String text,String name)方法,需要准备好html 字符串 #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)