Page 1 of 1

Pinting Table differs with Screen Resolution

Posted: Tue Apr 05, 2011 9:07 am
by jhonalone
I have created a 8 fil by 3 col thaat fill a Din A-4 paper on a PC at 800x600 resolution pixels. I've a image and text on each cell.

When I print table, it perfectly fills a Din A-4 page. All Right.

But when I try to print on another PC with 1280x800 there are two problems:

1.- Width is well, but Height is small.

2.- Images are too smallst.

Code: Select all

for r := 0 to table.Rows.Count-1 do
    for c := 0 to table.Rows[r].Count-1
    do begin
       table.Cells[r,c].BestWidth := AnchCols;
       table.Cells[r,c].BestHeight := AltFilas;
       table.SetCellVisibleBorders(False, False, False, False,r,c);
       table.SetCellVAlign(rvcMiddle,r,c); ///(rvcTop,  rvcMiddle, rvcBottom)
       end;
I'm using 1.9.48 version.

There is a Solution for this?
Many Thanks

Posted: Tue Apr 05, 2011 11:45 am
by Sergey Tkachenko
In TRichView versions prior to 13, sizes of objects like images are measured in "screen pixels". So, when printing, the size of images depends on the screen resolution, because it is calculated as
printing_width = original_width * printer_resolution / screen_resolution.
To make the results independent from the screen resolution, assign RichViewPixelsPerInch variable = 96.

PS: still, TRichViewEdit was not designed for WYSIWYG printing; it is implemented in ScaleRichView

Posted: Tue Apr 05, 2011 12:33 pm
by jhonalone
Sorry, I just posted a new post with more information.
But in the same PC, when change resolution, printing do not change.

Posted: Tue Apr 05, 2011 1:02 pm
by jhonalone
How can I change "RichViewPixelsPerInch variable = 96"? Please.

Posted: Tue Apr 05, 2011 2:36 pm
by jhonalone
Excuse me. I just found RichViewPixelsPerInch into Unit RVFuncs.
I'll try it now.
Best Regards Sergey, and thank you very much.

Posted: Tue Apr 05, 2011 3:21 pm
by jhonalone
Now all is OK.
Thanks.