20220315-bugs

This commit is contained in:
fuqingji
2022-04-13 10:35:03 +08:00
parent 90710da445
commit 76f9f448c6

View File

@ -124,10 +124,9 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
} }
File f = new File(path + "merged.pdf"); File f = new File(path + "merged.pdf");
FileOutputStream fos = null;
FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true); FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true);
try { try (FileOutputStream fos = new FileOutputStream(f);) {
fos = new FileOutputStream(f);
com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx"); com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx");
doc.save(fos, SaveFormat.PDF); doc.save(fos, SaveFormat.PDF);
} catch (Exception e) { } catch (Exception e) {
@ -135,11 +134,6 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
} finally { } finally {
source.close(); source.close();
addObj.close(); addObj.close();
if (fos != null) {
fos.flush();
fos.close();
}
} }
long l1 = System.currentTimeMillis(); long l1 = System.currentTimeMillis();