[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Postscript dilemma
Adem,
I brought a contcatenated Postscript output file up in Sun's Pageview
Postscript viewer and it works fine there. If you have access to this
viewer, you may want to use it instead of Ghostview. If Ghostview is your
only choice, here is an SQR program that will convert the file to a
format that Ghostview will work with. Note that the last write in the
program is for writing a CTRL-D into the file. The CTRL-D may not have
come over ok in the e-mail.
John L. Kellogg
MITI Technical Support Manager
begin-report
input $filename
open $filename as 1 for-reading record=80:vary
let $newfile = $filename || '.new'
open $newfile as 2 for-writing record=80:vary
!
! Read until you find first '%%EndProlog'
!
while 1
read 1 into $string:80
write 2 from $string
if $string = '%%EndProlog'
break
end-if
end-while
write 2 from ''
move 1 to #pageno
!
! Read until you find the next '%After data:'
!
loop:
while 1
read 1 into $string:80
if $string = '% After data:'
break
end-if
if substr($string,1,7) = '%%Page:'
!
! Change the '%%Page ? ?' line each time
!
let $string = '%%Page: ' || to_char(#pageno) || ' ' || to_char(#pageno)
add 1 to #pageno
end-if
write 2 from $string
end-while
!
! Read until next '%%EndProlog' or end of file
!
while 1
read 1 into $string:80
if #end-file
break
end-if
if $string = '%%EndProlog'
goto loop
end-if
end-while
!
! Write the after data lines
!
write 2 from ''
write 2 from '% After data:'
write 2 from '%%Trailer'
write 2 from 'server restore % Restore Postscript VM stack'
write 2 from ' '
!
! Close the files
!
close 1
close 2
end-report
Adem M. Hamidovic wrote:
>
> I'm having problems trying to merge several postscript reports into one
> single report. What I'm currently doing is generating the individual
> reports, than making a system call to cat them all into one file and
> remove the individual reports. This works fine, except that the final
> report now contains several individual postscript files, complete with
> repeated headers (font info, all that stuff). This works fine when
> sending it to a printer, but we would like to be able to look at this
> report in GSView prior to/instead of printing. When I open up said
> report in GSView, it states that I have 21 pages, when in actual fact I
> should have over 900. What it has done is look through the final report
> and found that the largest number of pages (for one of the individual
> reports) is 21. My question is, can I merge all those files into one
> file and still have it in postscript without having repeated headers? I
> would guess that I could create the reports in something other than
> postscript, cat them, and then (somehow) change the final file to
> postscript. Anyway, any and all suggestions would be greatly appreciated!
>
> -Adem Hamidovic