| | |
| | | pageSize = pdfWriter.getPageNumber(); |
| | | } |
| | | } catch (DocumentException e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | document1.setMargins(70, 70, 40, 40); |
| | |
| | | notHuaYanTable(document1, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | // 组装检验数据 |
| | |
| | | copy.close(); |
| | | } catch (IOException e) { |
| | | log.error("拷贝pdf异常"); |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | String outputFileName1 = customer.getCusId() + tjOrder.getTjNumber() + customer.getCusName() + "_报告.pdf"; |
| | |
| | | pdfReader.close(); |
| | | finalOutPut = outputStream; |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | savePDFFile(outputFileName1, tjOrder, customer, finalOutPut); |
| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data", lists); |
| | | map.put("jyys", hashSet); |
| | | if (StrUtil.isNotBlank(shsj)){ |
| | | shsj = shsj.split(" ")[0]; |
| | | } |
| | | map.put("shsj",shsj); |
| | | data.put(xmmc, map); |
| | | } |
| | |
| | | acroFields.setField(key, data.get(key).toString()); |
| | | } |
| | | //设置为无法编辑 |
| | | // pdfStamper.setFormFlattening(true); |
| | | pdfStamper.setFormFlattening(true); |
| | | pdfStamper.close(); |
| | | reader.close(); |
| | | // 将修改后的PDF内容写入 |