假脱机文件读取错误(未知字符) - Java(JT400)

时间:2013-08-20 19:06:22

标签: java ibm-midrange jt400

我正在尝试使用(Java(JT400))此代码>>读取假脱机文件。但它的输出无法读取。这是未知的字符返回。任何人都可以帮我解决这个问题。

提前致谢!

Java代码:

try {
    AS400 sys = new AS400();
    SpooledFile sf = new SpooledFile( sys,          // AS400
                            "CUSR_R1",       // splf name
                            2,           // splf number
                            "QPADEV003H",    // job name
                            "user",      // job user
                            "096018" );   // job number

    PrintParameterList printParms = new PrintParameterList();
    printParms.setParameter(PrintObject.ATTR_WORKSTATION_CUST_OBJECT,     "/QSYS.LIB/QWPGIF.WSCST");
    printParms.setParameter(PrintObject.ATTR_MFGTYPE, "*WSCST");

    // Create a page input stream from the spooled file
    PrintObjectPageInputStream is = sf.getPageInputStream(printParms);

    BufferedReader d = new BufferedReader(new InputStreamReader(is));
    String data ="";
    while((data = d.readLine() )!=null)
    {
        System.out.println (data);
    }
} catch (Exception e) {
    System.out.println(e);
}

输出:

GIF87a*L�
�Ģ�L*�̦�        �J�Ԫ���j�ܮ�����N����
������������@X�P�x��h��H8�(!�Ai`        ���x� �����)�:H�ɺ`�ɪ�`�            I�:K�{;ɫ+��K��l�|�k�  
etc..

编辑:

我已经修好了:D我错过了这段代码:)

printParms.setParameter(PrintObject.ATTR_WORKSTATION_CUST_OBJECT,     "/QSYS.LIB/QWPGIF.WSCST");

现在我修好了:D

替换此

printParms.setParameter(PrintObject.ATTR_WORKSTATION_CUST_OBJECT, "/QSYS.LIB/QWPDEFAULT.WSCST");

谢谢大家:D

0 个答案:

没有答案