import java.lang.*;
import java.io.*;
import java.text.*;
import com.pdfjet.*;
/**
* Example_12.java
*
*/
public class Example_12 {
|
|
public static void main(String[] args) throws Exception {
PDF pdf = new PDF();
Font f1 = new Font(pdf, "Helvetica");
Page page = new Page(pdf, Letter.PORTRAIT);
StringBuilder buf = new StringBuilder();
BufferedReader reader =
new BufferedReader(new FileReader("Example_12.java"));
String line = null;
while ((line = reader.readLine()) != null) {
buf.append(line);
// Both CR and LF are required by the scanner!
buf.append((char) 13);
buf.append((char) 10);
}
reader.close();
BarCode2D code2D = new BarCode2D(buf.toString());
code2D.setPosition(100, 60);
code2D.drawOn(page);
TextLine text = new TextLine(f1,
"PDF417 barcode containing the program that created it.");
text.setPosition(100, 40);
text.drawOn(page);
pdf.wrap();
pdf.save("Example_12.pdf");
}
} // End of Example_12.java
Example_12.pdf
© 2007 Innovatics Inc.

