Spread WPF Documentation
HeaderLeftImage Property (PrintInfo)
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > PrintInfo Class : HeaderLeftImage Property
Gets or sets the image for the left section of the header.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property HeaderLeftImage As System.Byte()
'Usage
 
Dim instance As PrintInfo
Dim value() As System.Byte
 
instance.HeaderLeftImage = value
 
value = instance.HeaderLeftImage
[System.ComponentModel.DefaultValue()]
public System.byte[] HeaderLeftImage {get; set;}

Property Value

The image for the left portion of the printed header. The default value is null, which means that no image is specified.
Example
This example uses the HeaderLeftImage property.
private byte[] StreamToBytes(System.IO.Stream stream)
        {
            byte[] bytes = new byte[stream.Length];
            stream.Read(bytes, 0, bytes.Length);
            stream.Seek(0, System.IO.SeekOrigin.Begin);
            return bytes;
        }

private void button1_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog file = new Microsoft.Win32.OpenFileDialog();
            if (file.ShowDialog() == true)
            {
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterCenterImage = StreamToBytes(file.OpenFile());
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterLeftImage = StreamToBytes(file.OpenFile());
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterRightImage = StreamToBytes(file.OpenFile());
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderCenterImage  = StreamToBytes(file.OpenFile());
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderLeftImage = StreamToBytes(file.OpenFile());
                this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderRightImage = StreamToBytes(file.OpenFile());
            }
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterCenter = "&G";
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterRight = "&G";
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.FooterLeft = "&G";
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderCenter = "&G";
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderRight = "&G";
            this.gcSpreadSheet1.ActiveSheet.PrintInfo.HeaderLeft = "&G";
         }

private void button2_Click(object sender, RoutedEventArgs e)
        {
            this.gcSpreadSheet1.SavePDF("c:\\zipfile\\test.pdf", 0);
         }
Private Function StreamToBytes(stream As System.IO.Stream) As Byte()
        Dim bytes As Byte() = New Byte(stream.Length - 1) {}
        stream.Read(bytes, 0, bytes.Length)
        stream.Seek(0, System.IO.SeekOrigin.Begin)
        Return bytes
    End Function


Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Dim file As New Microsoft.Win32.OpenFileDialog()
        If file.ShowDialog() = True Then
            GcSpreadSheet1.ActiveSheet.PrintInfo.FooterCenterImage = StreamToBytes(file.OpenFile())
            GcSpreadSheet1.ActiveSheet.PrintInfo.FooterLeftImage = StreamToBytes(file.OpenFile())
            GcSpreadSheet1.ActiveSheet.PrintInfo.FooterRightImage = StreamToBytes(file.OpenFile())
            GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderCenterImage = StreamToBytes(file.OpenFile())
            GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderLeftImage = StreamToBytes(file.OpenFile())
            GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderRightImage = StreamToBytes(file.OpenFile())
        End If
        GcSpreadSheet1.ActiveSheet.PrintInfo.FooterCenter = "&G"
        GcSpreadSheet1.ActiveSheet.PrintInfo.FooterRight = "&G"
        GcSpreadSheet1.ActiveSheet.PrintInfo.FooterLeft = "&G"
        GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderCenter = "&G"
        GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderRight = "&G"
        GcSpreadSheet1.ActiveSheet.PrintInfo.HeaderLeft = "&G"
    End Sub

Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
GcSpreadSheet1.SavePDF("c:\zipfile\test.pdf", 0)
End Sub
See Also

Reference

PrintInfo Class
PrintInfo Members