Page 1 of 1
Print Preview Margins
Posted: Sun Dec 06, 2009 6:19 pm
by rgsolutions
I am using the TSRVPreview (version 3). I cannot get the margins to display. I have tried setting the MarginsPen.Style to psDot at design time and at run time, and neither of the settings work.
Are there other settings that need to be set when moving from TRVPrintPreview to TSRVPreview?
Thanks,
Posted: Sun Dec 06, 2009 11:41 pm
by proxy3d
I think that margins for your printer very small or are equal 0. What value return in PrnRect?
Unit: SRVPreview.pas
Procedure:
procedure TSRVPreview. DrawContents (Canvas:TCanvas; const R: TRect);
Line:
with SRVPrint. SRVPrtInfo do
PrnRect: = Bounds (Round (MarginPixelsX * ScaleX),
Round (MarginPixelsY * ScaleY),
Round (PageResolutionX * ScaleX),
Round (PageResolutionY * ScaleY));
Posted: Sun Dec 13, 2009 6:03 pm
by rgsolutions
Sorry for the delay, got busy elsewhere.
I think there is some confusion. I am trying to use the existing TSRVPreview control to display a page and show the margin positions (lines) on the page. I have set the style on the control to show margin lines in the drawing (psDot of Style in MarginsPen). The page is displayed correctly with the appropriate margin space on all sides of the page. However, I do not get any lines indicating the position of the margins on the page.
Any other ideas?
Thanks,
Posted: Sun Dec 13, 2009 6:43 pm
by Sergey Tkachenko
You are right, TSRVPreview does not display margins rectangle and ignores this property. It will be fixed in the next update.
Posted: Tue Mar 16, 2010 4:24 pm
by Sergey Tkachenko
Fixed in v3.1.1
Posted: Thu Jul 22, 2010 7:31 pm
by rgsolutions
I have updated to the latest software and I now get a rectangle (dotted) displayed for the margins. However, the margins are set for A4 paper and not letter. I am using the TSRVPrint and TSRVPreview components.
If I set the PageFormat attribute to srvfmLetter, the change is made. However, when I set SRVPreview->PageNo, the processing changes the PageFormat back to srvfmCustom and I do not get the correct margins displayed (dotted rectangle).
How should I be going about this to display Letter size margins in the SRVPreview component?
Posted: Sun Jul 25, 2010 12:44 am
by proxy3d
What mode PrintMode you use?
In mode srvpAuto, SRVPrint resets PrintMode in srvfmCustom and finds the printer format similar to the format of the document in the SRV.
All modes SRVPrint (exclusion mode srvpPoster) can choose the paper size the printer itself, it is described in help.
Posted: Mon Aug 02, 2010 4:01 pm
by rgsolutions
I have tried what you suggest. I changed PrintMode to srvpStretchToFit. I now get a proportionally correct rectangle for the paper type.
However, the rectangle is not sized properly, it is too small. The displayed rectangle is inside the text area of the page. It looks like the margins are 10% larger than they should be.
I will send an e-mail to Sergey with a screen shot of what I am seeing.
Posted: Sat Aug 07, 2010 7:17 pm
by Sergey Tkachenko
Fixed in version 3.4.1