From 1805cd7d732f8a957c2b525a10c523d42fd3066b Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 17:05:25 +0900 Subject: [PATCH] WIP --- .../processor/impl/DocumentProcessorImpl.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index ad31fc6c..c4669c36 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -119,7 +119,17 @@ public class DocumentProcessorImpl implements DocumentProcessor{ } @Override - public void addNewPageAfterIndex(Bitmap bitmap, int index) { + public void addNewPageAfterIndex(Bitmap bitmap, int index) throws Exception { + logger.debug("addNewPageAfterIndex", "called"); + String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする + + this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename); + + XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel(); + xmlMetaPageModel.setFilename(filename); + xmlMetaPageModel.setIndex(index + 1); + xmlMetaModel.getPages().add(index, xmlMetaPageModel); + }