質問編集履歴

8

2017/12/06 23:52

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,5 @@
47
47
 
48
48
 
49
49
  [こちら](http://itext.2136553.n4.nabble.com/cell-setPhrase-vs-cell-addElement-was-leading-problem-td2137447.html) を見たところaddElementの方が良さそうだったのでaddElementにしたかったのですが空白が入り、、という状態です。
50
+
51
+ そもそも今回セルに入れたいのはPhraseではなくParagraphなのですが。

7

2017/12/06 23:52

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -24,15 +24,17 @@
24
24
 
25
25
  Paragraph paragraph = new Paragraph("aaa",font);
26
26
 
27
+ paragraph.setAlignment(Element.ALIGN_RIGHT);
28
+
27
29
 
28
30
 
29
31
  cell.setPhrase(paragraph); // cell.addElement(paragraph);の方が良いのか?試したところ、セルの上部に空白が入ってしまった。
30
32
 
31
33
 
32
34
 
35
+ // 網掛け設定
36
+
33
37
  cell.setGrayFill(0.8f);
34
-
35
-
36
38
 
37
39
  pdfPTable.addCell(cell);
38
40
 

6

2017/12/06 23:50

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- iTextでPDFを作成する処理を書いています。
1
+ JavaのiTextでPDFを作成する処理を書いています。
2
2
 
3
3
  デフォルトセルで枠線などを設定した後、new PdfPCellで作成したセルにも同じスタイルを適用したいです。
4
4
 

5

2017/12/06 09:33

投稿

shigure2
shigure2

スコア16

test CHANGED
@@ -1 +1 @@
1
- iTextでPDF作成時、newPdfPCellしたセルにもデフォルトセルのスタイルを適用したい
1
+ iTextでPDF作成時、new PdfPCellしたセルにもデフォルトセルのスタイルを適用したい
test CHANGED
@@ -1,6 +1,6 @@
1
1
  iTextでPDFを作成する処理を書いています。
2
2
 
3
- デフォルトセルで枠線などを設定した後、new Cellで作成したセルにも同じスタイルを適用したいです。
3
+ デフォルトセルで枠線などを設定した後、new PdfPCellで作成したセルにも同じスタイルを適用したいです。
4
4
 
5
5
  デフォルトセルのスタイルを適用した後、paragraphをaddElementしたところ、セルの上部に空白が入ってしまいました。
6
6
 

4

2017/12/06 09:15

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -41,3 +41,7 @@
41
41
 
42
42
 
43
43
  使用しているiTextのバージョンは1.4.6と古いです。
44
+
45
+
46
+
47
+ [こちら](http://itext.2136553.n4.nabble.com/cell-setPhrase-vs-cell-addElement-was-leading-problem-td2137447.html) を見たところaddElementの方が良さそうだったのでaddElementにしたかったのですが空白が入り、、という状態です。

3

2017/12/06 09:03

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  // デフォルトセルに枠線を設定
16
16
 
17
- pdfPTable.getDefaultCell.setBorderWidth(2);
17
+ pdfPTable.getDefaultCell().setBorderWidth(2);
18
18
 
19
19
  // デフォルトセルのスタイルを新しく作ったセルに設定
20
20
 
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- cell.setPhrase(paraphrase); // cell.addElement(paraphrase);の方が良いのか?試したところ、セルの上部に空白が入ってしまった。
29
+ cell.setPhrase(paragraph); // cell.addElement(paragraph);の方が良いのか?試したところ、セルの上部に空白が入ってしまった。
30
30
 
31
31
 
32
32
 
@@ -35,3 +35,9 @@
35
35
 
36
36
 
37
37
  pdfPTable.addCell(cell);
38
+
39
+
40
+
41
+
42
+
43
+ 使用しているiTextのバージョンは1.4.6と古いです。

2

2017/12/06 08:56

投稿

shigure2
shigure2

スコア16

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  デフォルトセルのスタイルを適用した後、paragraphをaddElementしたところ、セルの上部に空白が入ってしまいました。
6
6
 
7
- setPhraseなら見た目上は問題なくなくできたのですが、これで良いのでしょうか。
7
+ setPhraseなら見た目上は問題なくできたのですが、これで良いのでしょうか。
8
8
 
9
9
 
10
10
 

1

2017/12/06 08:52

投稿

shigure2
shigure2

スコア16

test CHANGED
@@ -1 +1 @@
1
- iTextでPDF作成時、
1
+ iTextでPDF作成時、newPdfPCellしたセルにもデフォルトセルのスタイルを適用したい
test CHANGED
File without changes