Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 29 May 2010 11:43:54 +0200
Hello Simone!
I think a solution would be to create a library of scripts (similar to Fabio's SCUIlib) to generate postscipt output. It is quite simple to create ps forms for printing needs. I am currently not interested in doing something like that, however I made it in Amos in the past. If you want i could send you the sources. Maybe it could be useful to adapt it to work in Hollywood.
The ps file then you could send to a ghostscript interpreter (like AmiGS on OS4) and the user can look a preview and print it.
Maybe the only obstacle is to reach image data directly in Hollywood (
ReadPixel() would be very slow for large images).
Andreas what do you think about let the user touch the memory area of a brush, sprite, etc?
Here is an sample extract of the mentioned Amos source. I think it is quite understandable:
Code: Select all
Procedure POSTSCRIPT_MAKE
' Opens the temporary postscript file
' Call this routine first!
Open Out 3,"T:temp_ps"
End Proc [3]
Procedure POSTSCRIPT_HEADER[c$,y$,t$,f]
' General A/4 header and footer
Print#f,"% Header for SymBase System"
Print#f,"/date ("+Cd Date$(Current Date)+") def"
Print#f,"/year ("+y$+") def"
Print#f,"/customer ("+c$+") def"
Print#f,"/title ("+t$+") def"
Print#f,"13 mm hline"
Print#f,"14 mm hline"
Print#f,"290 mm box"
Print#f,"usefont"
Print#f,"10 mm date alignright date show"
Print#f,"295 mm alignleft customer show"
Print#f,"295 mm year alignright year show"
Print#f,"/fontsize 18 def"
Print#f,"usefont"
Print#f,"290 mm title aligncenter title show"
Print#f,"% End of header"
End Proc
Procedure POSTSCRIPT_PAGE_NUMBER[f,n]
Print#f,"gsave 13 mm ("+str$(n)+") aligncenter
("+str$(n)+") show grestore"
End Proc
Procedure POSTSCRIPT_SZLA_ADAT1[f]
Print#f,"% Begin <szamla adatok>"
Print#f,"/rborder 100 mm def"
Print#f,"/ypos 250 mm def"
Print#f,"/string (Szamla kibocsatoja:) def printyl"
Print#f,"/string (Kelt:) def printyl"
Print#f,"/string (Szamla sorszama:) def printyl"
Print#f,"/string (tipusa:) def printyl"
Print#f,"/string (Brutto vegosszeg:) def printyl"
Print#f,"/lborder 100 mm def"
Print#f,"/ypos 250 mm def"
End Proc
Procedure POSTSCRIPT_TABLE_HEAD[f,h$,c]
' Set table column header text for the previously
setted table.(POSTSCRIPT_SETTABLE)
Print#f,"("+h$+") "+Str$(c)+" 1 lm ypos tableprintc"
End Proc
Procedure POSTSCRIPT_PRINTY[f,a$]
Print#f,"/string ("+a$+") def printy"
End Proc
Procedure POSTSCRIPT_SETTABLE[f,r,c,y,c$]
' Draws a table with:
' f - file from POSTSCRIPT_MAKE
' r - rows
' c - columns
' y - vertical position
Print#f,"/ypos"+str$(y)+" mm def"
Print#f,"/rborder rm def"
Print#f,"/lborder lm def"
Print#f,"/tabler"+str$(r)+" def"
Print#f,"/tablec"+str$(c)+" def"
Print#f,".1 setlinewidth"
Print#f,"/carray ["+c$+"] def"
Print#f,"lm ypos newtabledraw"
End Proc