Below are VBA functions to create PDF drawing commands for a white
rectangle with a black border and a black shadow. Perhaps someone will
find them useful.
'Sample call
strStream = strStream & RectangleWithShadow(200, 400, 250, 300, 1, 3,
3)
will create a rectangle at 200, 400 points that is 250 points wide and
300 points tall with a black border 1 point wide and a black shadow
that goes an additional 3 points in the x direction and an additional 3
points in the y direction.
'Begin module code
Public Function RectangleWithShadow(dblX As Double, dblY As Double,
dblW As Double, dblH As Double, dblThickness As Double, dblDeltaX As
Double, dblDeltaY As Double) As String
Dim strTemp As String
Dim strCR As String
strCR = Chr(13)
strTemp = "%RectangleWithShadow" & strCR
'White rectangle with a black shadow
strTemp = strTemp & FilledRectangle(dblX + dblDeltaX, dblY - dblDeltaY,
dblW, dblH, 0, 0, 0, dblThickness)
strTemp = strTemp & FilledRectangle(dblX, dblY, dblW, dblH, 1, 1, 1,
dblThickness)
RectangleWithShadow = strTemp
End Function
Public Function FilledRectangle(dblX As Double, dblY As Double, dblW As
Double, dblH As Double, dblR As Double, dblG As Double, dblB As Double,
dblThickness As Double) As String
Dim strTemp As String
Dim strCR As String
strCR = Chr(13)
strTemp = "%FilledRectangle Color = " & dblR & " " & dblG & " " & dblB
& strCR
strTemp = strTemp & "h" & strCR
strTemp = strTemp & "q" & strCR
strTemp = strTemp & dblThickness & " w" & strCR
strTemp = strTemp & dblR & " " & dblG & " " & dblB & " rg" & strCR
strTemp = strTemp & dblX & " " & dblY & " " & dblW & " " & dblH & " re"
& strCR
strTemp = strTemp & "b" & strCR
strTemp = strTemp & "Q" & strCR
FilledRectangle = strTemp
End Function
'End module code
James A. Fortune