Print Preview Margins

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
rgsolutions
Posts: 86
Joined: Mon Jun 08, 2009 11:25 pm

Print Preview Margins

Post 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,
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post 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));
rgsolutions
Posts: 86
Joined: Mon Jun 08, 2009 11:25 pm

Post 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,
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You are right, TSRVPreview does not display margins rectangle and ignores this property. It will be fixed in the next update.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Fixed in v3.1.1
rgsolutions
Posts: 86
Joined: Mon Jun 08, 2009 11:25 pm

Post 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?
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post 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.
rgsolutions
Posts: 86
Joined: Mon Jun 08, 2009 11:25 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Fixed in version 3.4.1
Post Reply