×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 13-May-2016 07:47 -0500, Michael Smith wrote:
I have several TXT files in an IFS directory that I need to convert
to PDF.
The original source for the TXT file data are "old" spool files that
no longer exist on the system.
The TXT files do not contain the printer control characters.
This is not a one time event, the conversion will have occur "real
time" on this files until I have developed a method to replace the
TXT file with a PDF file in our application programs.
Does anyone have suggestions on how to accomplish this?
If the data merely needs to be in PDF form, irrespective the
formatting for paging\pages, then just copy the data to QSYSPRT with the
builtin support spool to PDF converter activated; e.g. with the text
from a spooled file [without any CTLCHAR] residing in the stream file
txt01 in the current directory:
qsh /* CL command; following are QSH command-line requests: */
before="ovrprtf qsysprt devtype(*afpds) spool(*yes) wscst(*pdf)
tostmf('/home/myuserid/txt2pdf01') ovrscope(*actgrpdfn)"
after="dltovr qsysprt lvl(*actgrpdfn) /* ¿optional? */"
rm /home/myuserid/txt2pdf01
cat txt01 | Rfile -wQ -c "$before" -C "$after" qsysprt
Or similarly if prefer to avoid QSHELL, an all-CL script, but using
an explicit intermediate copy of the data from the STMF in a DBF:
crtpf qtemp/rll32 mbr(report) rcdlen(132)
CPYFRMSTMF FROMSTMF(txt01)
TOMBR('/qsys.lib/qtemp.lib/rl132.file/report.mbr')
MBROPT(*REPLACE) ENDLINFMT(*ALL) TABEXPN(*NO)
CVTDTA(*AUTO) STMFCCSID(*STMF) DBFCCSID(*FILE)
OVRPRTF FILE(QSYSPRT) TOSTMF('/home/myuserid/txt2pdf01')
WSCST(*PDF) DEVTYPE(*AFPDS) ovrscope(*calllvl)
rmvlnk '/home/myuserid/txt2pdf01'
cpyf qtemp/rl132 qsysprt frommbr(report)
As an Amazon Associate we earn from qualifying purchases.