ファイルからいくつかのテキストを読み込ん.txt
で、それらを pdf ファイルに書き込んでいます。しかし、私の pdf では、テキストが大きなフォントとして表示されています。ファイルのフォント サイズ.txt
を大きくしたり小さくしたりしても、pdf のフォントは同じになります。
テキストファイルへの書き込みの読み取りで動作している私のコードの一部
Document document = new Document(PageSize.A4.rotate(), 36, 36, 80, 160);
........
.........
document.newPage();
//Writing in a default page from the txt file
document.add(new com.lowagie.text.Paragraph("\n"));
iStream = new FileInputStream(path1); //path1 is location of .txt file
in = new DataInputStream(iStream);
is = new InputStreamReader(in);
br = new BufferedReader(is);
String strLine;
while ((strLine = br.readLine()) != null)
{
Paragraph para = new com.lowagie.text.Paragraph(strLine + "\n");
para.setAlignment(Element.ALIGN_JUSTIFIED);
document.add(new com.lowagie.text.Paragraph(strLine + "\n"));
}
br.close();
is.close();
in.close();
iStream.close();
document.close();
writer.close();
現在、windchill にサードパーティのライブラリを追加できないため、itext の下位バージョンを使用しています。このバージョンの itext は既に Windchill に含まれています。
書き込み時にpdfファイル内のフォントサイズを設定する方法.?どんな助けでも本当に役に立ちます.