I am using FOP (2.1) to create PDF documents by means of JZOS and have encountered a probmle similar but not equal to the one described in JZOS PDF encoding (http://community.dovetail.com/forum/vie ... =PDF#p4877).
After running FOP I get the result in a USS subdirectory (/pfd) and I would like to copy that result into a regular z/OS file referenced by the invoking JCL.
Everything works all right but when I try to open the PDF I get: There was an error openeing this document. The file is damaged and could not be repaired.
If I use the TSO command OGET:
Code: Select all
OGET '/ppo/chgmand/itm/fop/pdf/barcodes.pdf' barcodes.pdf BINARY
My ZFile dfinition is:
Code: Select all
ZFile tZosfile = new ZFile("//DD:PDFOUT", "wb");
Code: Select all
FileInputStream tIn = new FileInputStream(aFromFile);
OutputStream tOut;
if (aZos) ä
tOut = aToFile.getOutputStream();
å else ä
tOut = new FileOutputStream(aToFileName);
å
byteݨ buf = new byteÝ8092¨;
int len;
while ((len = tIn.read(buf)) >= 0) ä
tOut.write(buf, 0, len);
å
tIn.close();
tOut.close();
Regards Lars