getTrList() {
47 | return trList;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/HtmlTableTd.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | @Setter
7 | @Getter
8 | public class HtmlTableTd {
9 |
10 | private String text;
11 | private Integer width;
12 | private Integer height;
13 | private Integer colspan;
14 | private Integer rowspan;
15 | private String background;
16 | private String valign;
17 | private String align;
18 |
19 | private ExcelFontInfo font;
20 |
21 | @Override
22 | public String toString() {
23 | StringBuilder str = new StringBuilder();
24 | str.append("");
49 | if (text != null) {
50 | text = text.replace("\n", " ").replace(" ", " ");
51 | if (font != null) {
52 | str.append("");
66 | str.append(text);
67 | str.append("");
68 | } else {
69 | str.append(text);
70 | }
71 | } else {
72 | str.append(" ");
73 | }
74 | str.append(" | ");
75 | return str.toString();
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/HtmlTableTr.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class HtmlTableTr {
7 |
8 | private List tdList = new ArrayList();
9 |
10 | public HtmlTableTd getTd(int index) {
11 | return tdList.get(index);
12 | }
13 |
14 | public void addTd(HtmlTableTd td) {
15 | tdList.add(td);
16 | }
17 |
18 | public List getTdList() {
19 | return tdList;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/DocHtmlDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | import java.util.List;
4 |
5 | public abstract class DocHtmlDto {
6 |
7 | private String html;
8 | private List imageList;
9 |
10 | public String getHtml() {
11 | return html;
12 | }
13 |
14 | public void setHtml(String html) {
15 | this.html = html;
16 | }
17 |
18 | public List getImageList() {
19 | return imageList;
20 | }
21 |
22 | public void setImageList(List imageList) {
23 | this.imageList = imageList;
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/ExcelHtmlResultDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | import java.util.List;
4 |
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | @Setter
9 | @Getter
10 | public class ExcelHtmlResultDto extends DocHtmlDto {
11 |
12 | private List sheetList;
13 | private Integer activeSheetIndex;
14 | }
15 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/ExcelSheetDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | @Setter
7 | @Getter
8 | public class ExcelSheetDto {
9 |
10 | private String sheetName;
11 | private Integer sheetIndex;
12 | private String html;
13 | }
14 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/PDFHtmlResultDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | import java.util.List;
4 |
5 | public class PDFHtmlResultDto extends DocHtmlDto {
6 |
7 | @Override
8 | public String getHtml() {
9 | List imageList = getImageList();
10 | if (imageList != null && !imageList.isEmpty()) {
11 | StringBuilder result = new StringBuilder();
12 | for (String imagePath : imageList) {
13 | result.append("
");
14 | }
15 | return result.toString();
16 | }
17 | return null;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/PPTHtmlResultDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | import java.util.List;
4 |
5 | public class PPTHtmlResultDto extends DocHtmlDto {
6 |
7 | @Override
8 | public String getHtml() {
9 | List imageList = getImageList();
10 | if (imageList != null && !imageList.isEmpty()) {
11 | StringBuilder result = new StringBuilder();
12 | for (String imagePath : imageList) {
13 | result.append("
");
14 | }
15 | return result.toString();
16 | }
17 | return null;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/doc2html/bean/dto/WordHtmlDto.java:
--------------------------------------------------------------------------------
1 | package com.doc2html.bean.dto;
2 |
3 | public class WordHtmlDto extends DocHtmlDto {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/src/com/doc2html/config/Config.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenglix/doc2html/128468a1969457c6fbde04ca76215568c6c69cac/src/com/doc2html/config/Config.java
--------------------------------------------------------------------------------
/target/classes/doc2html.properties:
--------------------------------------------------------------------------------
1 | baseDir=D:/doc2htmltest
--------------------------------------------------------------------------------