Custom/PostScript
I use a template called "A4 script generic" which is below
pagesize A4
font Times-BoldItalic 30
linewidth 1
at 190x750 My-Name
color (black)
font Times-Roman 12
newpath at 75x725 line1
at 75x715 line2
at 75x705 line3
at 440x725 "Reg: "
at 465x725 medical-registration
at 445x715 "Ph: "
at 465x715 ph
at 445x705 "Fx: "
at 465x705 fx
at 75x680 "Date:" font Times-Bold at 105x680 today
font Times-Roman 14
at 75x655 patient-table
at 360x660 "Dob:" at 400x660 dob
newpath at 75x740 line 530x740
newpath at 75x700 line 530x700
font Times-Roman 12
at 75x570 prescription 30 60 250x600
font Times-Roman 12
at 140x72 "Signature:"
at 210x72 line 380x72
at 400x150 "Generic Substitution Permitted"
at 400x120 "Generic Substitution Not Permitted"
showpage
The "at nxn" tells the printer where to place the following item on the page. The item can be a keyword such as "My-name", or "patient-table" which takes information from the database or configuration settings. Or, it can be text as long as there is a font directive before that.
So, lets go thru this template line by line
pagesize A4
Set the pagesize to A4. Can be letter, or A5.
font Times-BoldItalic 30
Use the PostScript font, Times-BoldItalic in a 30 point size for the heading
linewidth 1
Use a linewidth of 1 point for any lines we draw. We are going to draw 3 lines in this template later on.
at 190x750 My-Name
On the page measured from the bottom left, place My-name at 190x750 points where there are 72 points per inch. My-name is set up in Settings.
color (black)
Use the color black for any printing until we change the color. Note the ( ).
font Times-Roman 12
Change the font to Times-Roman at 12 point size
newpath at 75x725 line1
Start a newpath ( ie. we've finished with the text now ), and at 75x725 place the text corresponding to Line1 of the doctors address in Settings.
at 75x715 line2
at 75x705 line3
Print Line2 and Line3 of the doctors address
at 440x725 "Reg: "
At 440x725 put the text "Reg: " still using the same font as last set.
at 465x725 medical-registration
Now at 465x725 ( on the same y setting, but 25 points to the right of "Reg: " ) put the medical registration as taken from the doctor's Settings.
at 445x715 "Ph: "
at 465x715 ph
at 445x705 "Fx: "
at 465x705 fx
Do similar for the phone and fax from Setttings
at 75x680 "Date:" font Times-Bold at 105x680 today
Put the text "Date: " and then change to a bold font before printing today's date.
font Times-Roman 14
Change to a larger font size of 14
at 75x655 patient-table
Now at 75x655, print the patient's address details as taken from the database.
at 360x660 "Dob:" at 400x660 dob
Print the date of birth
newpath at 75x740 line 530x740
newpath at 75x700 line 530x700
Draw a couple of parallel lines across the page 75x740 to 530x740, and 75x700 to 530x700
font Times-Roman 12
Change to a 12 point font
at 75x570 prescription 30 60 250x600
Print the prescription at 75x570. The 30x60 specifies the lowest point on the page it can print. If it goes beyond that, start a new column at 250x600
font Times-Roman 12
Reduce the font to point 12
at 140x72 "Signature:"
More text
at 210x72 line 380x72
Draw another line from 210x72 to 380x72 where we can sign our name
at 400x150 "Generic Substitution Permitted"
at 400x120 "Generic Substitution Not Permitted"
More text on the page
showpage
Finished . Tell the printer to print it out.
Graham Chiu
Beta Downloads and Documentation Wiki
Developer Forum