| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.config.IgnoreResponseAdvice |
| | | import org.docx4j.dml.wordprocessingDrawing.Inline |
| | | import org.docx4j.jaxb.Context |
| | | import org.docx4j.openpackaging.packages.WordprocessingMLPackage |
| | |
| | | |
| | | @ApiIgnore |
| | | @Controller |
| | | @IgnoreResponseAdvice |
| | | @RequestMapping("table") |
| | | class TableController { |
| | | |
| | |
| | | fun testdate() { |
| | | val wordMLPackage = WordprocessingMLPackage.createPackage() |
| | | wordMLPackage.mainDocumentPart.addAltChunk(AltChunkType.Html, t.block()!!.toString().toByteArray()) |
| | | val time = DateUtil().getTime(Date()).toString() |
| | | val time = DateUtil.getTime(Date()).toString() |
| | | val outputfilepath = File("/Users/liwei/resource/supervision/src/main/resources/public/htmltable.docx") |
| | | wordMLPackage.save(outputfilepath) |
| | | //Thread.sleep(1000) |
| | |
| | | |
| | | val paragraphOfText = wordMLPackage.mainDocumentPart.createParagraphOfText("Field 1") |
| | | addTableCell(tr, paragraphOfText) |
| | | val time = DateUtil().getTime(Date()) |
| | | val time = DateUtil.getTime(Date()) |
| | | val file = File("/Users/liwei/resource/supervision/src/main/resources/static/images/tutu.png") |
| | | val paragraphWithImage = addInlineImageToParagraph(createInlineImage(file)) |
| | | addTableCell(tr, paragraphWithImage) |