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

做刷网站海洋网络推广效果

做刷网站,海洋网络推广效果,一台云服务器可以做多少个网站,dockerfile wordpressjava itext5 生成PDF并填充数据导出 依赖**文本勾选框****页眉**#xff0c;**页脚****图片**实际图 主要功能有文本勾选框#xff0c;页眉#xff0c;页脚#xff0c;图片等功能。肯定没有专业软件画的好看#xff0c;只是一点儿方法。仅供参考。 依赖 !--pdf--**页脚****图片**实际图 主要功能有文本勾选框页眉页脚图片等功能。肯定没有专业软件画的好看只是一点儿方法。仅供参考。 依赖 !--pdf--dependencygroupIdcom.itextpdf/groupIdartifactIditextpdf/artifactIdversion5.5.13/version/dependencydependencygroupIdcom.itextpdf/groupIdartifactIditext-asian/artifactIdversion5.2.0/version/dependency文本勾选框 生成勾选框的图片将图片插入到文本前面 private static Image checkBoxPng;static {ClassPathResource classPathResource new ClassPathResource(CHECK_BOX_PATH);try {byte[] byteArray FileCopyUtils.copyToByteArray(classPathResource.getInputStream());checkBoxPng Image.getInstance(byteArray);} catch (IOException | BadElementException e1) {e1.printStackTrace();}}-------------------------------------------------------------------------final Paragraph paragraph new Paragraph();if (checkBox ! null checkBox) {try { // final Image png Image.getInstance(CHECK_BOX_PATH);// y轴 向下偏移5 保证大致上都是水平的final Chunk chunk new Chunk(checkBoxPng, 0, -5);paragraph.add(chunk);} catch (Exception e) {throw new BusinessException(e.getMessage());}}paragraph.add(new Phrase(value, font));页眉页脚 itext5没有页眉页脚设置的api所以用的是定位的方式 new Document()时预留出页眉和页脚数据所需要的空间大小 pdfPTable.writeSelectedRows(); 定位的方式把表格定位到对应的位置上即可 Slf4j Component public abstract class HeaderFooterEventHelper extends PdfPageEventHelper {/*** 页眉*/protected final ListCustomExportTemplateModuleDTO headerList;/*** 页脚*/protected final ListCustomExportTemplateModuleDTO footerList;public HeaderFooterEventHelper(ListCustomExportTemplateModuleDTO headerList,ListCustomExportTemplateModuleDTO footerList) {this.headerList headerList;this.footerList footerList;}/*** 一页加载完成触发写入页眉和页脚*/Overridepublic abstract void onEndPage(PdfWriter writer, Document document); }//移除边距 方便设置页眉和页脚 定制页眉页脚Document document new Document(PageSize.A4,-30 ObjectUtils.defaultIfNull(module.getLeftMargin(), 0),-30 ObjectUtils.defaultIfNull(module.getRightMargin(), 0),// 页眉高度 间隙高度 /页脚高度 - 间隙高度 (页面底部有一部分真空区域headerSize GAP_SIZE ObjectUtils.defaultIfNull(module.getUpMargin(), 0),footerSize GAP_SIZE ObjectUtils.defaultIfNull(module.getDownMargin(), 0));ByteArrayOutputStream baos new ByteArrayOutputStream();final PdfWriter writer PdfWriter.getInstance(document, baos);// 初始化 页眉、页脚数据体writer.setPageEvent(new HeaderFooterEventHelper(headerDTOS, footerDTOS) {Overridepublic void onEndPage(PdfWriter writer, Document document) {final ICustomExportTemplateService customExportTemplateService SpringContextUtil.getBean(ICustomExportTemplateService.class);if (customExportTemplateService ! null) {customExportTemplateService.setPdfData(this.headerList, writer, ZERO);customExportTemplateService.setPdfData(this.footerList, writer, ONE);}}});------------------------------------------------------------------- Overridepublic void setPdfData(ListCustomExportTemplateModuleDTO moduleDTOS, PdfWriter writer, Integer type) {float size 0;final float sumSize getSumSize(moduleDTOS);for (CustomExportTemplateModuleDTO item : moduleDTOS) {PdfPTable pdfPTable; // 创建的表格pdfPTable.setTotalWidth(PageSize.A4.getWidth());pdfPTable.setWidthPercentage(WIDTH_PERCENT);if (Objects.equals(type, ZERO)) {// 页眉 基点为 左下角0点 高度为 A4全高 - 使用高度pdfPTable.writeSelectedRows(0, -1, ZERO,PageSize.A4.getHeight() - size, writer.getDirectContent());} else if (Objects.equals(type, ONE)) {// 页脚 基点为 左下角0点 高度为 列表使用总高度 - 使用高度pdfPTable.writeSelectedRows(0, -1, ZERO,sumSize - size, writer.getDirectContent());}if (item.getLabel().equals(2)) {size BigDecimal.valueOf(item.getData().size()).multiply(BigDecimal.valueOf(CELL_SIZE)).intValue();} else {// 默认每行高度为 25size CELL_SIZE;}}} 图片 PdfPCell cell new PdfPCell(); // 我这里是根据文件服务器上的图片链接进行获取的。 cell.setImage(Image.getInstance(MinioUtil.getUrlName(imageUrl)));实际图
http://www.hkea.cn/news/14256850/

相关文章:

  • 博山做网站公司上海网站商城建设公司
  • w微信网站开发c 网站开发数据库连接
  • 深圳签网站口碑营销话题
  • o2o网站wordpress斜杠
  • 广州网站建设设计公司手机网页打不开是什么原因
  • 如何选择电商网站建设wordpress 内容 管理
  • 办网站租服务器做旅游攻略的网站
  • 建行网站会员是什么logo在线设计制作
  • 律所网站建设国队男子接力赛上海公司建立网站吗
  • wordpress软件站主题兰州网站建设专家
  • 西宁公司网站设计线上营销方法有哪些
  • 深圳知名网站建设平台dedecms5.7装饰公司网站模板
  • 网站建设能赚多少钱网站内容建设和管理
  • 网站建设投标文件如何网推
  • 重庆网站建设公司招聘前端直播网站怎么做
  • 陕西榆林市信息网站建设公司兰州 网站建设公司
  • 如果查询网站内页的收录情况石家庄seo管理
  • 申请网站建设经费玉泉路网站建设
  • 网站开发发展存在的问题新余 网站建设
  • 网站开发与托管协议合肥有什么好的网站建设公司
  • h5网站开发软件有名vi设计公司
  • 制作网站怎么制作网页无法访问但是有网什么原因
  • 网站建设主机耗电量淘宝网页版手机登录
  • 净水机企业网站源码东山县建设银行网站
  • 有没有做生鲜配送的网站骨科医院网站模板
  • 保定门户网站昆明网站建设手机版
  • 网站建设工资郑州一个县城广告公司利润
  • 企业网站开发公司管理咨询人员的基本素质
  • 怎样推广自己的商城为什么打开网址都是seo综合查询
  • 做食品那些网站好衡水哪里做网站