This genie will rearrange a document designed as double-page spreads to fit on the sheets of a simple stapled booklet. It only works for Postscript output. The pages are arranged so you can print the first half of the document on one side of the paper and then turn the paper over for the other half.
Written by Don Cox
*/
cr = '0a'x
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
colormode = ppm_GetColorMode()
call ppm_SetColorMode(0)
oldpsout = ppm_GetPSOutput()
call ppm_SetBatchMode(1)
prevdoc = ppm_GetDocName()
if ppm_DocChanged() then
do
if ppm_SavedDate() = "Not Saved" then prevdoc = ""
if ppm_Inform(2, "You must save the current document first. Should I save and continue?", "Cancel", "Ok") then
call ppm_SaveDocument(prevdoc)
else
exit_msg("Aborted by User")
prevdoc = ppm_GetDocName()
end
totalpages = ppm_NumPages()
if totalpages = 0 then exit_msg("No pages")
lpos = lastpos("/",prevdoc) /* Find end of pathname */
if lpos = 0 then lpos = lastpos(":",prevdoc)
docname = substr(prevdoc,lpos+1) /* Strip off pathname */