import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import wkc.pdf.PdfException;
import wkc.pdf.tool.Report;
import wkc.pdf.tool.ReportException;

public class OrderFormFin {
	private static File FORM_DIRECTORY_ROOT = new File("../resources/form");
	private static File OUTPUT_DIRECTORY_ROOT = new File(".");

	public static void main(String[] args) throws IOException, ReportException, PdfException {
		File outPdfFile = new File(OUTPUT_DIRECTORY_ROOT, "OrderFormFin.pdf");
		File formFile = new File(FORM_DIRECTORY_ROOT, "template.pdf");
		File datFile = new File(FORM_DIRECTORY_ROOT, "template.dat");
		FileOutputStream fout = new FileOutputStream(outPdfFile);
		Report report = null;
		try {
			//reportファイルをつくる。
			report = new Report(formFile, datFile, fout);
			report.createPage(1);
			report.close();
			report = null;
		} finally {
			if (report != null) {
				try {
					//必ずclose()を呼びます。
					report.close();
				} catch (ReportException e) {
					//例外処理
				}

			}
		}
	}
}