views:

443

answers:

1

can someone please show me documentation on this method?

i have the following line:

datatable.WriteSelectedRows(0, -1, document.LeftMargin, document.TopMargin, writer.DirectContent)

and it doesnt seem to matter whether its topmargin or bottommargin, it puts it at the bottom of the page.

+1  A: 

Hey avrohom -

The way absolute positioning works is that the Y coordinate you want needs to be subtracted from the max height of the document. What I've done is create a constant:

Public Const INCH As Integer = 72

Because 72 is the number of points that creates an inch. Then you can create other constants based on this constant, such as:

Public Const MAX_HEIGHT As Single = 11 * INCH
Public Const MAX_WIDTH As Single = 8.5 * INCH
Public Const TOP_MARGIN As Single = 0.5 * INCH

etc.

So to place something at the top of the page, your Y coordinate should be:

MAX_HEIGHT - TOP_MARGIN

Hope this helps :)

Jason