FirstPageHeaderGap: Double;
The FirstPageHeaderGap property determines indent for a header on the first page.
To set footer indent for the first page, use the ITabSheetPrinter.FirstPageFooterGap property.
Executing the example requires the form containing the components:
Button with the Button1 identifier.
TabSheetBox with the TabSheetBox1 identifier.
UiTabSheet with the UiTabSheet1 identifier.
ImageBox with the ImageBox1 identifier.
Specify the UiTabSheet1 component as a data source for the TabSheetBox1 component.
The file system must include the C:/map.bmp file containing an image.
Add links to the Drawing, Tab system assemblies.
The example is a handler of the OnClick event for the Button component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
tSheet: ITabSheet;
Printer: ITabSheetPrinter;
pCount: Integer;
Graphics: IGxGraphics;
m_Image: IGxImage;
Begin
tSheet := UiTabSheet1.TabSheet;
Printer := tSheet.CreatePrinter;
// Set up indents for the first page
Printer.FirstPageHeaderGap := 30;
Printer.FirstPageFooterGap := 30;
Printer.DifferentFirstPageGap := True;
// Set up indents for even pages
Printer.EvenHeaderGap := 20;
Printer.EvenFooterGap := 20;
Printer.DifferentEvenPageGap := True;
pCount := Printer.GetPageCount;
If pCount > 0 Then
m_Image := New GxImage.CreateFromFile("C:/map.bmp");
Graphics := GxGraphicsClass.FromImage(m_Image);
Printer.PrintPage(1, Graphics);
m_Image.SaveToFile("C:/map1.bmp");
ImageBox1.Image := m_Image;
End If;
End Sub Button1OnClick;
Clicking the Button1 button sets up indents for the first page and for even pages. The TabSheetBox1 component contents will be saved to the C:/map1.bmp file and loaded to the ImageBox1 component.
See also: