|
|
@@ -32,27 +32,25 @@ import java.nio.file.*;
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
public class HtmlConvertToPdf implements InitializingBean {
|
|
|
- @Value("${html2Pdf.simsumPath}")
|
|
|
+ // @Value("${html2Pdf.simsumPath}")
|
|
|
private String simsumPath;
|
|
|
- @Value("${html2Pdf.simfangPath}")
|
|
|
+// @Value("${html2Pdf.simfangPath}")
|
|
|
private String simfangPath;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
+// @Override
|
|
|
public void afterPropertiesSet() throws Exception {
|
|
|
- String[] fontPath = { simsumPath, simfangPath };
|
|
|
- for (String path : fontPath) {
|
|
|
- String aimPath = path.substring(path.indexOf("/"));
|
|
|
- Path temp = Paths
|
|
|
- .get(new File(HtmlConvertToPdf.class.getClassLoader().getResource("").getPath().concat(aimPath))
|
|
|
- .getAbsolutePath());
|
|
|
- if (Files.exists(temp)) {
|
|
|
- Files.delete(temp);
|
|
|
- }
|
|
|
- Files.copy(HtmlConvertToPdf.class.getClassLoader().getResourceAsStream(path), temp,
|
|
|
- StandardCopyOption.REPLACE_EXISTING);
|
|
|
- }
|
|
|
+// String[] fontPath = { simsumPath, simfangPath };
|
|
|
+// for (String path : fontPath) {
|
|
|
+// String aimPath = path.substring(path.indexOf("/"));
|
|
|
+// Path temp = Paths
|
|
|
+// .get(new File(HtmlConvertToPdf.class.getClassLoader().getResource("").getPath().concat(aimPath))
|
|
|
+// .getAbsolutePath());
|
|
|
+// if (Files.exists(temp)) {
|
|
|
+// Files.delete(temp);
|
|
|
+// }
|
|
|
+// Files.copy(HtmlConvertToPdf.class.getClassLoader().getResourceAsStream(path), temp,
|
|
|
+// StandardCopyOption.REPLACE_EXISTING);
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|