home *** CD-ROM | disk | FTP | other *** search
- /* This Genie changes a portrait format page to landscape, and vice versa. It sets up the Postscript output specs correctly.
- Written by Don Cox July '92. Adapted for PDraw, Dec '93 */
-
-
-
- signal on error
- signal on syntax
- address command
-
-
- cpage = pdm_CurrentPage()
- psize = pdm_GetPageSize(cpage)
- Xsize = word(psize,1)
- Ysize = word(psize,2)
-
- if Xsize = Ysize then exit_msg("Page is square")
- if Xsize<Ysize then
- do
- shape = "Portrait"
- newshape = "Landscape"
- neworient = 2
- end
- else do
- shape = "Landscape"
- newshape = "Portrait"
- neworient = 1
- end
-
- choiceint = pdm_Inform(2,"Page is currently "shape". Convert to "newshape"?","Yes","No")
- if choiceint ~=0 then exit_msg("No change")
-
- call pdm_SetPageSize(cpage,Ysize,Xsize)
- orient = pdm_GetPSOutputOrient(cpage)
-
- call pdm_SetPSOutputOrient(cpage,neworient)
-
- call exit_msg()
-
- end
-
- error:
- syntax:
- do
- exit_msg("Genie failed due to error: "errortext(rc))
- end
-
- exit_msg:
- do
- parse arg message
- if message ~= "" then
- call pdm_Inform(1,message,"Resume")
- call pdm_ClearStatus()
- call pdm_AutoUpdate(1)
- exit
- end
-
-