Type TPDFPrint_PageSize(Width As Float, Height As Float)
Type TPDFPrint_PageMargins(Left As Float, Top As Float, Right As Float, Bottom As Float, TopOfPage As Float, EndOfPage As Float)
Private mPageSize As TPDFPrint_PageSize
Private mMargins As TPDFPrint_PageMargins
#Region PDFDrawRectangle
Public Sub PDFDrawRectangle(RectToDraw As Rect, Color As Int, Filled As Boolean, Stroke As Int, FillColor As Int) As Rect
Dim RealDraw As Rect
RealDraw.Initialize(RectToDraw.Left, RectToDraw.Top, RectToDraw.Right, RectToDraw.Bottom)
If RealDraw.Right = -1 Then
RealDraw.Right = (mPageSize.Width - (mMargins.Right + RealDraw.Left))
End If
If RealDraw.Bottom = -1 Then
RealDraw.Height = (mPageSize.Height - (mMargins.Bottom + RealDraw.Top)) ' this is line 592
End If
RealDraw.Left = RealDraw.Left + mMargins.Left
RealDraw.Top = RealDraw.Top + mMargins.Top
mPDF.DrawRect(RealDraw, Color, False, Stroke)
If Filled Then
mPDF.DrawRect(RealDraw, FillColor, True, Stroke)
End If
Return RealDraw
End Sub
#end Region