ExcelHeaderFooterSection
OfficeIMO.Excel
A left, center or right section of a header or footer: text with Excel codes, and an optional picture.
Inheritance
- object
- ExcelHeaderFooterSection
Usage
Explore 3 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 3
- Property ExcelHeaderFooter.Center
- Property ExcelHeaderFooter.Left
- Property ExcelHeaderFooter.Right
Methods
public void SetImage(byte[] imageBytes, string contentType = "image/png", OfficeLength? width = null, OfficeLength? height = null) #Sets the section picture and adds the &G placeholder to its text.
Parameters
- imageBytes byte[]
- Image bytes.
- contentType string = "image/png"
- Image content type, such as image/png or image/jpeg.
- width OfficeIMO.OfficeLength? = null
- Optional physical width; inferred from the image when omitted.
- height OfficeIMO.OfficeLength? = null
- Optional physical height; inferred from the image when omitted.
Exceptions
NotSupportedException– The section belongs to a first-page or even-page variant.
public Task SetImageFromUrlAsync(string url, OfficeLength? width = null, OfficeLength? height = null, CancellationToken cancellationToken = default) #Downloads an image and sets it as the section picture.
Parameters
- url string
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SetImageFromUrlAsync(string url, OfficeRemoteImageLoadOptions remoteImageOptions, OfficeLength? width = null, OfficeLength? height = null, CancellationToken cancellationToken = default) #Downloads an image under an explicit remote-network policy and sets it as the section picture.
Parameters
- url string
- remoteImageOptions OfficeIMO.Drawing.OfficeRemoteImageLoadOptions
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
TaskInherited Methods
Properties
public ExcelHeaderFooterPosition Position { get; } #Which section this is.
public string Text { get; set; } #Section text. Excel codes such as &P (page), &N (pages), &D (date), &A (sheet name) and &G (picture) are kept; other ampersands are written literally. An empty string clears the section.
public ExcelHeaderFooterImageInfo? Image { get; } #The section picture; null when it has none. Pictures are supported in the running header and footer.