Adding EPS to PDF: see eps.pdf
External resources for this example: parrot.ps tiger.ps
下に示す例は、スタンドアロンツールになっています。Tiff2Pdf は、TIFF ファイルを PDF にします。TIFF がマルチページならば、複数ページのPDFが作成されます。
Converts some tiff files to PDF: see 12.pdf 338814-00.pdf even.pdf odd.pdf
External resources for this example: 12.tif 338814-00.tif odd.tif even.tif
OddEven は、SourceForge ライブラリの TiffTools の一部の tiffmesh example に刺激されたものです。Tiffmesh は、奇数ページを含むものと偶数ページを含むものの二つのTIFFファイルをかみ合わせて、一つの大きなTIFFにするものです。両面印刷のテキストをスキャンすると奇数ページのTIFFと、偶数ページのTIFFのが出来上がります。Tiffmesh によってこれら二つのファイルを一つにまとめられます。OddEven ツールは、同じことをしますが、ひとつのPDFが出来上がります。
Combines 2 tiffs, one with odd, another with even pages into 1 combined PDF: see combined.pdf
External resources for this example: odd.tif even.tif
- Barcode39: code 39 と 拡張 code 39
-
Barcode128:
- CODE128 - plain barcode 128.
- CODE128_UCC - AI の全リストを持つ、UCC/EAN-128 をサポート
- CODE128_RAW - RAW モード。コード属性は、'\uffff'に続く 0 から 105 までの実効コードと人間に可読なテキスト。
- BarcodeEAN: EAN13、EAN8、UPCA、UPCE、EAN with supplemental 5、EAN with supplemental 5、EAN with supplemental 2
- BarcodeEANSUPP: takes 2 barcodes、an EAN/UPC and a supplemental
- BarcodeInter25: interleaved 2 of 5
- BarcodePostnet: postnet and planet
- BarcodePDF417: 2D バーコード PDF417
- BarcodeCodabar: codabar
PdfContentByte cb = writer.getDirectContent();
BarcodeEAN codeEAN = new BarcodeEAN();
codeEAN.setCodeType(codeEAN.EAN13);
codeEAN.setCode("9780201615883");
Image imageEAN = codeEAN.createImageWithBarcode(cb, null, null);
document.add(new Phrase(new Chunk(imageEAN, 0, 0)));
List with different barcodes: see barcodes.pdf
Example barcode ean128: see ean128.pdf
Example barcode pdf417: see pdf417.pdf
すべてのバーコードクラスは、抽象クラスの Barcode を実装しています。特定のバーコード型の規定値と、バーコードの'見た目'を代えるメソッドの違いを確認するためにもAPIドキュメントを読んでください。iText により文書にバーコードを追加すると、それは、createImageWithBarcode(com.lowagie.text.pdf.PdfContentByte, java.awt.Color, java.awt.Color)) あるいは、createTemplateWithBarcode(com.lowagie.text.pdf.PdfContentByte, java.awt.Color, java.awt.Color) によって、イメージあるいは PdfTemplateに変換されます。バーとテキストの色は、次のように決定される。
| barColor | textColor | Result |
|---|---|---|
| null | null | bars and text painted with current fill color |
| barColor | null | bars and text painted with barColor |
| null | textColor | bars painted with current color text painted with textColor |
| barColor | textColor | bars painted with barColor text painted with textColor |
テキストがないバーコードが必要ならば、setFont(com.lowagie.text.pdf.BaseFont)
によってフォントに null を設定するだけです。
バーコードオブジェクトの
reateAwtImage(java.awt.Color, java.awt.Color)
によって、テキストがない java.awt.Image を作成することができることも付け加えておきます。