• R/O
  • SSH
  • HTTPS

pdf-brewer: コミット


コミットメタ情報

リビジョン16 (tree)
日時2020-06-11 10:11:23
作者hirukawa_ryo

ログメッセージ

* pdf-brewer 0.4.2
PDF作成アプリケーション名を指定するsetCreatorメソッドを追加しました。
PDF変換アプリケーション名を指定するsetProducerメソッドを追加しました。

変更サマリ

差分

--- pdf-brewer/trunk/src/main/java/net/osdn/pdf_brewer/PdfBrewer.java (revision 15)
+++ pdf-brewer/trunk/src/main/java/net/osdn/pdf_brewer/PdfBrewer.java (revision 16)
@@ -76,8 +76,6 @@
7676 return null;
7777 }
7878
79- private String producer;
80- private String creator;
8179 private PDRectangle mediaBox;
8280 private PDDocument document;
8381 private PDPage page;
@@ -95,10 +93,8 @@
9593 document = new PDDocument();
9694
9795 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());
10298 }
10399
104100 public FontLoader getFontLoader() {
@@ -106,17 +102,45 @@
106102 }
107103
108104 public String getProducer() {
109- return this.producer;
105+ PDDocumentInformation info = document.getDocumentInformation();
106+ return info.getProducer();
110107 }
108+
109+ public void setProducer(String producer) {
110+ if(producer == null) {
111+ producer = "";
112+ }
113+ PDDocumentInformation info = document.getDocumentInformation();
114+ info.setProducer(producer);
115+ }
111116
112117 public String getCreator() {
113- return this.creator;
118+ PDDocumentInformation info = document.getDocumentInformation();
119+ return info.getCreator();
114120 }
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+
116135 public void setTitle(String title) {
117136 PDDocumentInformation info = document.getDocumentInformation();
118137 info.setTitle(title);
119138 }
139+
140+ public String getAuthor() {
141+ PDDocumentInformation info = document.getDocumentInformation();
142+ return info.getAuthor();
143+ }
120144
121145 public void setAuthor(String author) {
122146 PDDocumentInformation info = document.getDocumentInformation();
旧リポジトリブラウザで表示