リビジョン | 16 (tree) |
---|---|
日時 | 2020-06-11 10:11:23 |
作者 | ![]() |
* pdf-brewer 0.4.2
PDF作成アプリケーション名を指定するsetCreatorメソッドを追加しました。
PDF変換アプリケーション名を指定するsetProducerメソッドを追加しました。
@@ -76,8 +76,6 @@ | ||
76 | 76 | return null; |
77 | 77 | } |
78 | 78 | |
79 | - private String producer; | |
80 | - private String creator; | |
81 | 79 | private PDRectangle mediaBox; |
82 | 80 | private PDDocument document; |
83 | 81 | private PDPage page; |
@@ -95,10 +93,8 @@ | ||
95 | 93 | document = new PDDocument(); |
96 | 94 | |
97 | 95 | PDDocumentInformation info = document.getDocumentInformation(); |
98 | - producer = getDefaultProducer(); | |
99 | - info.setProducer(producer); | |
100 | - creator = getDefaultCreator(); | |
101 | - info.setCreator(creator); | |
96 | + info.setProducer(getDefaultProducer()); | |
97 | + info.setCreator(getDefaultCreator()); | |
102 | 98 | } |
103 | 99 | |
104 | 100 | public FontLoader getFontLoader() { |
@@ -106,17 +102,45 @@ | ||
106 | 102 | } |
107 | 103 | |
108 | 104 | public String getProducer() { |
109 | - return this.producer; | |
105 | + PDDocumentInformation info = document.getDocumentInformation(); | |
106 | + return info.getProducer(); | |
110 | 107 | } |
108 | + | |
109 | + public void setProducer(String producer) { | |
110 | + if(producer == null) { | |
111 | + producer = ""; | |
112 | + } | |
113 | + PDDocumentInformation info = document.getDocumentInformation(); | |
114 | + info.setProducer(producer); | |
115 | + } | |
111 | 116 | |
112 | 117 | public String getCreator() { |
113 | - return this.creator; | |
118 | + PDDocumentInformation info = document.getDocumentInformation(); | |
119 | + return info.getCreator(); | |
114 | 120 | } |
115 | - | |
121 | + | |
122 | + public void setCreator(String creator) { | |
123 | + if(creator == null) { | |
124 | + creator = ""; | |
125 | + } | |
126 | + PDDocumentInformation info = document.getDocumentInformation(); | |
127 | + info.setCreator(creator); | |
128 | + } | |
129 | + | |
130 | + public String getTitle() { | |
131 | + PDDocumentInformation info = document.getDocumentInformation(); | |
132 | + return info.getTitle(); | |
133 | + } | |
134 | + | |
116 | 135 | public void setTitle(String title) { |
117 | 136 | PDDocumentInformation info = document.getDocumentInformation(); |
118 | 137 | info.setTitle(title); |
119 | 138 | } |
139 | + | |
140 | + public String getAuthor() { | |
141 | + PDDocumentInformation info = document.getDocumentInformation(); | |
142 | + return info.getAuthor(); | |
143 | + } | |
120 | 144 | |
121 | 145 | public void setAuthor(String author) { |
122 | 146 | PDDocumentInformation info = document.getDocumentInformation(); |