Connie,
I use enscript and ghostscript with a few home grown utilities.
Works pretty well. Let me know if I can help. Lars help me with this.
Ray
USER DEFINED COMMAND FILE: RPT2PDF.CMDFILE.SYS
parm filein=" ",fileout=" "
parm email="NOEMAIL",Sub="Sendpdf",orient ="-r", paper="Letter"
parm font="Courier7/7" ,encoding="ps", move2wb="Y",options="0"
parm outpdf="pdf.pdf"
parm pagesize=" "
option nobreak
#HPDATETIME = 20120510084821600
setvar mydt lft("!hpdatetime",12)
echo !mydt
if "!mydt" > "201205121700"
if "!filein"=" " or "!fileout" =" " or not finfo("!filein",0)
echo Emails a legacy report to a user in PDF format, printable
echo !hpfile !filein,!fileout,!email,!sub,!orient,!paper,!font,!move2wb
echo
echo Input - Input file name
echo Output - Output file name
echo Email - email address or Bemsid 8 chars M0000011 or NOEMAIL
echo NoEMAIL will not send an email.
echo Sendusrs or a indirect file is accepted for multiple
echo Sub - Subject
echo ORIENT - "-r" for landscape, "-R" for portrait
echo Paper - " " for Letter, A3 or A4
echo Font - Courier7/7 font points wide/points high 8/8 10/10
echo Encoding- -X 88591-88595,88597,ascii,asciifi,ps,pslatin1,hp8,mac
echo default is ps . Asciifi is scandinavian chars
echo Move2wb - Move to the WEB. Y or N
echo Options - 0 If email present send emails
echo 1 Do not Send any emails
echo outpdf - "pdf.pdf" Default output pdf name
echo
echo Requires Enscript & GhostScript see
echo http://www.editcorp.com/Personal/Lars_Appel/index.html
echo
echo Example: randname w
echo comment use the above to create a random file name.
echo Rpt2pdf wichita1,w,m0005392,"test pdf1",move2wb='N',options=0
echo Rpt2pdf wichita1,w,^indfile,"test pdf1",move2wb='Y',options=0,outpdf="name_
12.pdf"
echo ------------- Available fonts -----------------------
if "!hpjobtype" = "S"
input x,"press return to continue";readcnt=1
endif
echo AvantGarde-Book AvantGarde-Demi AvantGarde-DemiOblique
echo AvantGarde-BookOblique Bookman-Demi Bookman-DemiItalic Bookman-Light
echo Bookman-LightItalic Courier Courier-Bold Courier-BoldOblique
echo Courier-Oblique Garamond-Bold Garamond-BoldItalic Garamond-Light
echo Garamond-LightItalic Helvetica Helvetica-Bold Helvetica-Oblique
echo Helvetica-BoldOblique Helvetica-Narrow Helvetica-Narrow-Bold
echo Helvetica-Narrow-BoldOblique Helvetica-Narrow-Oblique
echo LubalinGraph-Book LubalinGraph-BookOblique LubalinGraph-Demi
echo LubalinGraph-DemiOblique Miryam-Iso Miryam-IsoBold
echo Miryam-IsoBoldItalic Miryam-IsoItalic
echo NarkissimIso NarkissimIso-Bold NarkissimIso-BoldItalic
echo NarkissimIso-Italic NarkissTamIso NarkissTamIso-Bold
echo NarkissTamIso-BoldItalic NarkissTamIso-Italic NewCenturySchlbk-Bold
echo NewCenturySchlbk-Italic NewCenturySchlbk-Roman Optima Optima-Bold
echo Optima-BoldOblique Optima-Oblique Palatino-Bold Palatino-BoldItalic
echo Palatino-Italic Palatino-Roman Rokaa Rokaa-Bold Rokaa-BoldItalic
echo Rokaa-Italic Setting Setting-Bold Setting-BoldItalic
echo Setting-Italic ShalomIso ShalomIso-Bold ShalomIso-BoldItalic
echo ShalomIso-Italic Souvenir-Demi Souvenir-DemiItalic Souvenir-Light
echo Souvenir-LightItalic Times-Bold Times-BoldItalic Times-Italic
echo Times-Roman Typing Typing-Bold Typing-BoldItalic Typing-Italic
echo Symbol ZapfChancery-MediumItalic ZapfDingbats
echo
echo
else
if not finfo("*sendusrs",0) then
file sendusrs=sendusrs.cmdfile.sys,old
endif
echo !hpfile !filein,!fileout,!email,!sub,!orient,!paper,echo !font,!move2wb
if finfo("!fileout",0)
echo
purge !fileout
echo !fileout Exists.... Purged.
endif
setvar cr2_len len("!email")
setvar cr2_bems str("!email",2,!cr2_len)
if str(ups("!email"),1,1) = "M" and numeric("!cr2_bems")
setvar cr2_myemail "[log in to unmask]"
else
setvar cr2_myemail ups("!email")
endif
if pos("^","!cr2_myemail") > 0
setvar towho1 str("!cr2_myemail",2,len("!cr2_myemail"))
setvar towho1 finfo("!towho1",1)
setvar eof finfo("!towho1","end of file")
setvar linenum 1
setvar list ""
while linenum <= eof
print !towho1;start=!linenum;end=!linenum > temp
input temp_list < temp
setvar list "!list" + " " + "!temp_list"
setvar linenum !linenum + 1
endwhile
comment showvar list
setvar cr2_myemail "!list"
else
xeq *sendusrs "!cr2_myemail"
setvar cr2_myemail "!mail_user"
endif
file in=!filein
randname out
if finfo("!out",0)
randname out
endif
run cr2lineR.util.sys;info="count"
echo !recordsize !linesperpage
setvar linesPerPage linesPerPage + 6
file out=!out
run cr2lineR.util.sys;parm=!linesperpage;info="ASA"
mpe2hfs !out,myout
file out=!out,old
randname mypdf
file mypdf=!mypdf
randname out1
mpe2hfs !out1,myout1
if "!pagesize" = " "
setvar lpp "!linesperpage"
else
setvar lpp "!pagesize"
endif
echo !out,!mypdf,!recordsize,!linesperpage,!lpp,!orient,!paper, !font
xeq /ORG/GNU/opt/enscript/v1.6.1/bin/enscript '-B --no-job-header -L !lpp -X !en
coding -r -M!paper -f !FONT -o !myout1 !myout'
continue
xeq accesshp.cmdfile.sys "/ORG/GNU/opt/ghostscript/v7.05/bin/gs"
xeq /ORG/GNU/opt/ghostscript/v7.05/bin/gs '-dNOPAUSE -dBATCH -sDEVICE=pdfwrite -
sOutputFile=!mypdf !myout1'
purge !out
purge !out1
rename !mypdf,!fileout
if ups("!move2wb") = "Y" then
if "!options" = "1" then
echo No Email will be sent
echo move2wb !fileout,pdf,"NOEMAIL","!sub"
move2wb !fileout,pdf,"NOEMAIL","!sub"
else
echo move2wb !fileout,pdf,"!cr2_myemail","!sub"
move2wb !fileout,pdf,"!cr2_myemail","!sub"
endif
else
if pos("NOEMAIL","!cr2_myemail") > 0 or "!options" = "1"
echo No File was Emailed.
else
comment
echo mailspf2 !cr2_myemail,"!sub",!fileout,!outpdf
mailspf2 "!cr2_myemail","!sub","!fileout","!outpdf"
endif
endif
echo Output file: ![finfo("!fileout",1)]
deletevar mypdf,out,cr2_myemail
reset in
reset out
reset mypdf
endif
else
# add to work around a GhostScript hang
#
run quit.util.sys
Endif
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|