Set Table Position To Actual Paper Location

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Set Table Position To Actual Paper Location

Post by DickBryant »

I need to create a 2x5 table which will print to an exact location on the printed page at exact height and width. This will be a template for the Avery 2 column, 5 row "business card" stock.

It isn't clear to me how to translate the 'pixel' measurements for setting up margins, row heights and widths to actually correspond to mm (or inches) when the document is printed.

Can you help with this?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

First, you need to make your RichView independent of the screen resolution, otherwise the results will depend on small fonts/large fonts mode.
To do it, assign nonzero value (recommended: 96) to the global variable RichViewPixelsPerInch. It makes printing of tables and pictures independent of the screen mode.
You can do the same for text: assign the same value to RVStyle.TextStyles.PixelsPerInch.

Converting from pixels to inches:
InchValue = PixelsValue/RichViewPixelsPerInch
Converting from pixels to mm:
MMValue = (PixelsValue*127)/(RichViewPixelsPerInch*5)
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Thanks, Sergey - very timely - I'm starting on this code in the morning :-)
Post Reply