This is for all those who have requested copies:
I received an email this morning reporting that text2pdf was failing
with "cannot open "/account/grpup/PDFTEMP" for input: No such file or
directory" when you try to convert a spoolfile.
After some investigation I have discovered that the version of the
text2pdf command file I have supplied you (from our production system)
is not as it should have been (some of the 01.04 modification was
missing, looks as if a restore prior to version 01.05 was the cause).
The code below is from our DR system and works as it should. My
apologies to those who have been inconvenienced.
---------- start snip here ----------
parm fname='?'
anyparm switchs=-SLANDREPT
if lft('!fname',1) = '?' then
setvar t 'echo ![chr(14)+"R"+rpt(";",78)]'
setvar m 'echo ![chr(14)+"5"+rpt(";",78)]'
setvar b 'echo ![chr(14)+"F"+rpt(";",78)]'
setvar s 'echo ![chr(14)+":"+chr(15)]'
!t
!s TEXT2PDF - Converts a text/spool file to an Acrobat .pdf file.
!m
!s
!s Syntax:
!s
!s TEXT2PDF fname [switch]
!s
!s Parameters:
!s
!s fname Name of file to be converted.
!s Text File = filename[.group[.account]]
!s Spoolfile = nnn OR Onnn OR Onnn.OUT.HPSPOOL
!s switchs following options are available (default: -SLANDREPT):
!s -SLANDREPT Use 160 chars * 60 lines on A4 Landscape.
!s -A4 Use A4 paper (default: letter).
!s -A3 Use A3 paper (default: letter).
!s -x[width] Independent paper width in points.
!s -y[height] Independent paper height in points.
!s -c[chars] Maximum characters per line (default: 80).
!s -s[size] Use font at given pointsize (default: 10).
!s -f[font] Use PostScript [font] (default: Courier).
!s -l[lines] Lines per page (default: 60)
!s (determined automatically if unspecified).
!s -v[dist] Use given line spacing (default: 12 points).
!s -t[spaces] Spaces per tab character (default: 8).
!s -2 Format in 2 columns.
!s -L Use landscape mode (default: portrait).
!s -F Ignore formfeed characters (^L).
!s -I Use ISOLatin1Encoding.
!s
!s Description:
!s
!s This script converts text and spool files to pdf files that are
!s compatible with Adobe Acrobat Reader.
!s
!s The -SLANDREPT switch overrides ALL other switches.
!s
!s Where one variable is implied by two options, the second option
takes
!s precedence for that variable (e.g. -A4 -y500).
!s
!s In landscape mode, page width and height are simply swapped over
before
!s formatting, no matter how or when they were defined.
!s
!s Examples:
!s
!s TEXT2PDF MYFILE
!s
!s Converts the contents of MYFILE to A4 pages that are 160
characters by
!s 60 lines in landscape orientation.
!s
!s Restrictions:
!s
!s MPE/iX temporary files can not be converted as the text2pdf
program is
!s unable to see them. This is a limitation caused by the way Posix
is
!s implemented within MPE/iX.
!s
!b
#
# Author: Robert W.Mills
#
# Modification History can be found at the end of this file.
#
deletevar t, m, b, s
return
endif
setvar text2pdf_spoolfile false
if pos('.OUT.HPSPOOL',ups('!fname')) > 0 then
setvar text2pdf_spoolfile true
setvar text2pdf_fname '!fname'
elseif numeric('!fname') then
setvar text2pdf_spoolfile true
setvar text2pdf_fname 'O!fname.OUT.HPSPOOL'
elseif lft(ups('!fname'),1) = 'O' &
and numeric(rht(word('!fname','.'),-2)) then
setvar text2pdf_spoolfile true
setvar text2pdf_fname '!fname.OUT.HPSPOOL'
else
setvar text2pdf_fname '!fname'
endif
if not finfo('!text2pdf_fname','exists') then
echo ERROR: The text/spool file does not exist.
return
endif
setvar text2pdf_switchs anyparm(!switchs)
if pos('-SLANDREPT',ups('!text2pdf_switchs')) > 0 then
setvar text2pdf_switchs '-y950 -x800 -L -c160 -l60'
endif
if text2pdf_spoolfile then
setvar text2pdf_temp 'pt!hppin'
if finfo('!text2pdf_temp','exists') then
purge !text2pdf_temp
endif
build
![text2pdf_temp];rec=![finfo('!text2pdf_fname','recsize')],,f,ascii&
;disc=![finfo('!text2pdf_fname','eof')]
file !text2pdf_temp,old
print !text2pdf_fname;start=3;page=0;out=*!text2pdf_temp
setvar text2pdf_text '![finfo('*!text2pdf_temp','posixfullfname')]'
else
setvar text2pdf_text '![finfo('!text2pdf_fname','posixfullfname')]'
endif
setvar text2pdf_pdf '![basename('!text2pdf_fname')].pdf'
if finfo('./!text2pdf_pdf','exists') then
purge ./!text2pdf_pdf
endif
setvar text2pdf_prog '/usr/local/bin/text2pdf'
setvar text2pdf_files '< !text2pdf_text > !text2pdf_pdf'
sh "-c '![text2pdf_prog] ![text2pdf_switchs] ![text2pdf_files]'"
echo --- Acrobat PDF file is called: ![text2pdf_pdf]
#-- Tidy up.
purge !text2pdf_temp
deletevar text2pdf_@
return
#-- DO NOT ENTER EXECUTABLE CODE AFTER ABOVE 'RETURN' STATEMENT.
Modification History:
Versn | Date | Who | Reason for Change
------+------------+-----+------------------------------------------
01.00 | 15/10/2001 | RWM | Initial version.
01.01 | 23/10/2001 | RWM | Added default switch -SLANDREPT.
01.02 | 09/05/2002 | RWM | Added double quotes in the sh command.
| | | Required by the MPE/iX shell.
01.03 | 08/10/2002 | RWM | Corrected bug in spoolfile handling.
01.04 | 09/10/2002 | RWM | Corrected bug in spoolfile handling.
01.05 | 23/07/2004 | RWM | text2pdf moved to /usr/local/bin from
| | | /usr/local/contrib/bin
#===================================================================
# End of command file.
#===================================================================
---------- end snip here ----------
regards,
Robert W.Mills
Business Systems Development Analyst
Group Information Systems & Technology
Pinnacle Entertainment
DDI: +44 (0)20 8309 3604
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|