FirstPageHeaderGap: Double;
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;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
tSheet: ITabSheet;
Printer: ITabSheetPrinter;
pCount: Integer;
Graphics: GxGraphics;
GraphClass: GxGraphicsClass;
GxClass: GxImageClass;
m_Image: GxImage;
Begin
tSheet := UiTabSheetNet1.TabSheetUi.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
GxClass := New GxImageClassClass();
m_Image := GxClass.FromFile("C:/map.bmp");
GraphClass := New GxGraphicsClassClass();
Graphics := GraphClass.FromImage(m_Image);
Printer.PrintPage(1, Graphics);
m_Image.SaveToFile("C:/map1.bmp");
PictureBox1.Image := Image.FromFile("C:/map1.bmp");
End If;
End Sub;
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: