Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import org.apache.commons.io.FileUtils;
import com.fujitsu.systemwalker.outputassist.connector.*;
public class sample {
public static void main(String[] args) {
try {
testPdf();
}catch ( UnsatisfiedLinkError e ){
e.printStackTrace( );
}catch ( Exception e ){
e.printStackTrace( );
}
}
public static void testPdf() throws IOException {
Forms form = null; /* Formsクラス */
String sHomePath; /* 帳票格納ディレクトリ名 */
String sAssets; /* 帳票格納ディレクトリ名 */
String sCsvDir; /* CSVインポートファイル格納ディレクトリ名 */
String sPdfDir; /* PDF出力ファイル格納ディレクトリ名 */
String sErrCsv; /* CSVインポート処理エラー情報ファイル名 */
sAssets = "C:/Interstage/Assets";
sCsvDir = "C:/Interstage/CSV";
sPdfDir = "C:/Interstage/PDF";
sErrCsv = "err_list_shori.csv";
try{
/* 帳票名を設定する */
String sFormName = "売上伝票";
FileUtils.writeStringToFile(new File(sPdfDir, sErrCsv), "", "UTF-8", true);
/* Forms クラスを作成する */
try {
form = new Forms( sFormName, sAssets );
/* 入力データを指定します */
// form.pushRecord("2118588|神奈川県川崎市中原区|上小田中X-X-X|△△△△電気");
form.pushRecord("2118588|神奈川県川崎市中原区|上小田中X-X-X|△△△△電気|20031221|03101|005|0022|カラオケセット|1|82000|1234567890|20031221|03101|005|0020|カラーテレビ|3|120000|1234567890");
form.pushRecord("2118588|神奈川県川崎市中原区|上小田中X-X-X|△△△△電気|20031221|03101|005|0100|電気掃除機|2|23000|1234567890");
// form.pushRecord("2118588|神奈川県川崎市中原区|上小田中X-X-X|△△△△電気
// |20031221|03101|005|0001|電気スタンド|7|10000|1234567890");
// form.pushRecord("1008211|東京都千代田区|丸の内Y-Y-Y|○○○○電気
// |20031221|03102|005|0100|電気掃除機|2|23000|1234567890");
// form.pushRecord("1008211|東京都千代田区|丸の内Y-Y-Y|○○○○電気
// |20031221|03102|005|0110|冷蔵庫|2|125000|1234567890");
// form.pushRecord("1008211|東京都千代田区|丸の内Y-Y-Y|○○○○電気
// |20031221|03102|005|0201|電気カーペット|5|10000|1234567890");
// form.pushRecord("1008211|東京都千代田区|丸の内Y-Y-Y|○○○○電気
// |20031221|03102|005|0211|電気ストーブ|3|5000|1234567890");
// form.pushRecord("1008211|東京都千代田区|丸の内Y-Y-Y|○○○○電気
// |20031221|03102|005|0221|電気ごたつ|3|7800|1234567890");
/* PrintProperties オブジェクトを構築する */
PrintProperties prop = new PrintProperties();
/* 出力方法を指定する(PDFファイル) */
prop.setProperty( PrintProperties.ID_DIRECTMETHOD, "PDF" );
/* プロパティ指定(PDFファイル名)を行う */
prop.setProperty( PrintProperties.ID_KEEPPDF, sPdfDir + "/aa_bbb_cccc.pdf" );
/*---帳票を出力する-----------------------------------------*/
/* PrintForm オブジェクトを作成する */
PrintForm pform = new PrintForm();
/* 帳票を出力する */
pform.PrintOut( form, prop );
} catch (ConnectorException e) {
FileUtils.writeStringToFile(new File(sPdfDir, sErrCsv), "|20031221|03102|005" + "rn", "UTF-8", true);
FileUtils.writeStringToFile(new File(sPdfDir, sErrCsv), "|20031888|03102|005" + "rn", "UTF-8", true);
}
}finally {
try{
/* Javaインタフェースが使用している資源を解放する */
if ( form != null ){
form.cleanup();
}
}catch ( Exception e ){
e.printStackTrace();
}
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team